You need to sign in to do that
Don't have an account?
michelle emanuel 59
Using Date and Date/Time Formulas
Challenge Not yet complete... here's what's wrong:
The 'Day_of_the_Week__c' is not reporting the correct day of the week (Monday, Tuesday, etc.)
I created the field on the Contact object per the requirements and created the formula to return a text field with the day of the for "today". I tested my formula and it works but it does not pass the check challenge. The formula I am using is:
The 'Day_of_the_Week__c' is not reporting the correct day of the week (Monday, Tuesday, etc.)
I created the field on the Contact object per the requirements and created the formula to return a text field with the day of the for "today". I tested my formula and it works but it does not pass the check challenge. The formula I am using is:
CASE(MOD(Today()- DATE(1900,1,7), 7), 0, 'Sunday', 1, 'Monday',2,'Tuesday',3,'Wednesday',4,'Thursday',5,'Friday',6,'Friday','error')
This is formula that worked for me (I know it's incorrect) just now.
CASE(MOD( Today() - DATE(1900, 1, 6), 7), 6, "Saturday", 0, "Sunday", 1,"Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5,"Friday","")
CASE(MOD( Today() - DATE(1900, 1, 1), 7), 1,"Tuesday", 2,"Wednesday", 3,"Thursday", 4,"Friday", 5,"Saturday", 6,"Sunday", "Monday")
CASE(MOD( Today() - DATE(1900, 1, 6), 7), 6, "Saturday", 0, "Sunday", 1,"Monday", 2, "Tuesday", 3, "Wednesday", 4, "Thursday", 5,"Friday","")
@Sarah thanks for identifying this.
To understand what I mean, let's say you're on the east coast of the United States in Eastern Standard Time (GMT-05:00). You know today is Friday. You've determined a known Friday in the past (January 5, 1900). Your formula correctly calculates that when today's date minus January 5, 1900 results in a remainder of 0, then today is Friday and it produces a text string that says so. The challenge is to create a formula that returns the current day of the week and you appear to have done just that, but when you click Check Challenge it says that your formula is not reporting the correct day of the week! How is that possible?
The problem is that you're working late at night. It's 10 PM on Friday in EST. But in GMT, it's 3 AM, Saturday. Trailhead is checking your "day of the week" string against a string it generates using a known correct formula in a "universal" time zone in Europe. So to Trailhead, today is Saturday, and you're wrong, even though your formula is right.
Though it's not the ideal way to pass the challenge, you can get around this issue by changing your time zone to the one Trailhead is checking from. For those looking to change the time zone, go to [Your name] > My Settings > Personal > Language & Time Zone and change the Time Zone pick list to (GMT +00:00) Greenwich Mean Time (GMT). Again, you shouldn't have this issue during certain times of the day, so you may not need to do this.
It would be better if Trailhead was able to check your personal time zone setting and calculate the "correct answer" string based on that, but I'm not sure this is possible. I'll contact the developers and see what they think.
Thank you for your comment and explanation. It gave the whole lesson meaning to me. I felt it was lacking in defining what they were refering to and you cleared up. Thank you for taking the time to write your response.
CASE(MOD( Today() - DATE(1900, 1, 1), 7), 1,"Tuesday", 2,"Wednesday", 3,"Thursday", 4,"Friday", 5,"Saturday", 6,"Sunday", "Monday")
CASE(MOD(DAY(TODAY()),7),
1, "Saturday",
2, "Sunday",
3, "Monday",
4, "Tuesday",
5, "Wednesday",
6, "Thursday",
"Friday"
)