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
Sami ShakithSami Shakith 

How to get Day of created date using formula field

Hi,

I want to find the day of paticular date e.g if my date is 28-jun-16 then my formula field should be written as thursday. How can i achieve this? please give me some suggestions.
Best Answer chosen by Sami Shakith
vijaya kudupudivijaya kudupudi
Hi smal shahul,

Can you try this...

CASE(
MOD(DATEVALUE(CreatedDate) - DATE(1900, 1, 6), 7),
0, "Sunday",
1, "Monday",
2, "Tuesday",
3, "Wednesday",
4, "Thursday",
5, "Friday",
6, "Saturday", "Error")

 

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Sami Shahul,

Here is a formula that will return the text for what day of the week 

The data type is TEXT

CASE( 
MOD(CreateDate - DATE(2000, 1, 7), 7), 
0, "Sunday", 
1, "Monday", 
2, "Tuesday", 
3, "Wednesday", 
4, "Thursday", 
5, "Friday", 
6, "Saturday", "Error")

For more information please refer to the below link
https://help.salesforce.com/HTViewHelpDoc?id=formula_examples_dates.htm

Hope this helps...

Kindly mark my solution as the best answer if it helps you.

Best Regards,
Nagendra.P
Sami ShakithSami Shakith
Hi Nagendra,

I tried this one. But it showing error value for all records
Ishwar ShindeIshwar Shinde
try this - 


CASE( MOD( Date__c - DATE(1900, 1, 7), 7), 0, "Sunday", 1, "Monday", 2, "Tuesday", 3,
"Wednesday", 4, "Thursday", 5, "Friday", 6, "Saturday","Error")
vijaya kudupudivijaya kudupudi
Hi smal shahul,

Can you try this...

CASE(
MOD(DATEVALUE(CreatedDate) - DATE(1900, 1, 6), 7),
0, "Sunday",
1, "Monday",
2, "Tuesday",
3, "Wednesday",
4, "Thursday",
5, "Friday",
6, "Saturday", "Error")

 
This was selected as the best answer
Sami ShakithSami Shakith
Hi vijaya kudupudi,

Its working fine for me. Thank you so much.