Activity Forums Salesforce® Discussions How can I know the Day of the Week of a Date in Salesforce?

  • Surbhi

    Member
    May 31, 2016 at 6:03 am

    Hi Ravi,

    In SOQL, use the "DAY_IN_WEEK()". It returns a number representing the day of the week for a date field.

    In formula field, you can use this:

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

    Thanks

  • Avnish Yadav

    Member
    September 29, 2018 at 8:29 pm

    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")

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos