Question

Extract Day of Week from Date

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 0

Like

2 comments
Best reply

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

thanks Ryan

Show all comments