Forum Discussion
MCFNeil
8 years agoQrew Captain
So QB doesn't give you any easy way to convert the Date to the text value. So you first have to get the Day value and then convert that to text, then include the text into your div.
DayOfWeek (Date d)
Description: Returns the number of days by which the given date d follows the first day of the week (Sunday returns 0).
Example: DayOfWeek([Start Date]) returns the number of the day of the week for the date that appears in the Start Date field.
DayOfWeek(ToDate("Aug 23, 2000")) returns 3
DayOfWeek(ToDate("Aug 20, 2000")) returns 0
Then a Case formula. So your text variable might be:
var text DAY=Case(DayOfWeek([Due Date]),
0, "Sunday",
1, "Monday",
2, "Tuesday",
3, "Wednesday",
4, "Thursday",
5, "Friday",
6, "Saturday", "")
and combine that with your div to have:
If([Due Date]<Today(), "<div style=\"background-color:yellow;\"> $DAY, "&ToText([Due Date])&" </div>", "$DAY, "&ToText([Due Date]) )
DayOfWeek (Date d)
Description: Returns the number of days by which the given date d follows the first day of the week (Sunday returns 0).
Example: DayOfWeek([Start Date]) returns the number of the day of the week for the date that appears in the Start Date field.
DayOfWeek(ToDate("Aug 23, 2000")) returns 3
DayOfWeek(ToDate("Aug 20, 2000")) returns 0
Then a Case formula. So your text variable might be:
var text DAY=Case(DayOfWeek([Due Date]),
0, "Sunday",
1, "Monday",
2, "Tuesday",
3, "Wednesday",
4, "Thursday",
5, "Friday",
6, "Saturday", "")
and combine that with your div to have:
If([Due Date]<Today(), "<div style=\"background-color:yellow;\"> $DAY, "&ToText([Due Date])&" </div>", "$DAY, "&ToText([Due Date]) )