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
Coral RacingCoral Racing 

Formula to show CreatedDate last 2 days

Hello

I am trying to create a formula to show tickets created last 2 days.  In a report I thought about using a literal date range filter to show last n days nut I cant see an option to do a custom last n days only 7, 30,60,90,120.

Is there a formula to show CreateDate last 2 days?


Many thanks

Sonya

Sonya
 
Best Answer chosen by Coral Racing
Pritam ShekhawatPritam Shekhawat

CreatedDate is not a Date datatype field it's a DateTime datatype, you need to convert it using a DATEVALUE function like this. 
Try this  TODAY () - DATEVALUE(CreatedDate) 

All Answers

Coral RacingCoral Racing
Sorry I forgot to say this is to include today or Now() + Last 2 days
Coral RacingCoral Racing
CreatedDate = LAST_N_DAYS:2   as far as I am aware doesn't include today?
Coral RacingCoral Racing
I tried this (Now()- CreatedDate < 3) but this didn't work
Coral RacingCoral Racing
Hello Thanks for the reply As this is workflow it doesn’t recognise .date() so I tried Now() - CreatedDate
Pritam ShekhawatPritam Shekhawat

CreatedDate is not a Date datatype field it's a DateTime datatype, you need to convert it using a DATEVALUE function like this. 
Try this  TODAY () - DATEVALUE(CreatedDate) 
This was selected as the best answer
Coral RacingCoral Racing
Great thanks. This works Thankyou