function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Michelle ArndtMichelle Arndt 

Formula Help

I have a formula field as a checkbox and this is the formula:
(TODAY() -  LastModifiedDate ) <= 30

I get and error stating: "Error: Incorrect parameter type for operator '-'. Expected Number, Date, received DateTime"

I want this box to check if there has been activity within the last 30 days.
Best Answer chosen by Michelle Arndt
Mahesh DMahesh D
You can try this:

(TODAY() -   DATEVALUE(LastModifiedDate ) ) <= 30

Regards,
Mahesh

All Answers

Mahesh DMahesh D
You can try this:

(TODAY() -   DATEVALUE(LastModifiedDate ) ) <= 30

Regards,
Mahesh
This was selected as the best answer
sandeep@Salesforcesandeep@Salesforce
Use the DATEVALUE( date/time ) function to return the Date value of a Date/Time.
IF(((TODAY() - DATEVALUE(LastModifiedDate))<=30), true, false)
Thanks
Sandeep Singhal
http://www.codespokes.com/