Hi
What is best way to extract the day of the week (Mon-Fri) from a date field? Basically want to have count of specific Activities broken down by day of the week (based on start date)
Like
Assuming you're needing this in a process. You can use the following to get the day of the week in a process formula:
[#MyDateFieldHere#].DayOfWeek
You can use that value as a string, like this:
[#MyDateFieldHere#].DayOfWeek.ToString() == "Monday"
Or using the numeric values for the days (see values here)
[#MyDateFieldHere#].DayOfWeek == 1
For example, to check if the date is a weekday (not sat and not sun)
[#MyDateFieldHere#].DayOfWeek.ToString() != "Saturday" && [#MyDateFieldHere#].DayOfWeek.ToString() != "Sunday"
Ryan
Assuming you're needing this in a process. You can use the following to get the day of the week in a process formula:
[#MyDateFieldHere#].DayOfWeek
You can use that value as a string, like this:
[#MyDateFieldHere#].DayOfWeek.ToString() == "Monday"
Or using the numeric values for the days (see values here)
[#MyDateFieldHere#].DayOfWeek == 1
For example, to check if the date is a weekday (not sat and not sun)
[#MyDateFieldHere#].DayOfWeek.ToString() != "Saturday" && [#MyDateFieldHere#].DayOfWeek.ToString() != "Sunday"
Ryan