+ Start a Discussion
pavan 14pavan 14 

Date and time Functions using Case

Getting error "Error: Incorrect parameter type for operator '-'. Expected Number, DateTime, received Date". while creating workflow rule checking condition forcustom object feild Created date and implement the rule only during mon.tue,wed,thurs,fri using CASE function.please help or correct

CASE(
MOD(  CreatedDate - DATE( 1900, 1, 7 ), 7 ),

1, "Monday",
2, "Tuesday",
3, "Wednesday",
4, "Thursday",
5, "Friday",
"None"
)
Best Answer chosen by pavan 14
karthikeyan perumalkarthikeyan perumal
hello 

Use below formula

CASE(
MOD(CreatedDate - DATETIMEVALUE("1900-01-07 12:00:00"),7),

1, "Monday",
2, "Tuesday",
3, "Wednesday",
4, "Thursday",
5, "Friday",
"None"
)

Hope it will help you. Mark Best ANSWER if its work for you.


Thanks
karthik