Forum Discussion
IF Statements For Date and Time
- 6 years ago
Anonymous
The syntax is for M query.
Open Edit queries, Add column->Custom Column -> Paste your script and rename the column.
If this helps, mark it as a solution
Kudos are nice too
Anonymous
The syntax is for M query.
Open Edit queries, Add column->Custom Column -> Paste your script and rename the column.
If this helps, mark it as a solution
Kudos are nice too
Going to add another level of complexity here, How about bringing in Days of the week?
Example:
Sunday through Tuesday 6:00 am-6:00 pm and Wednesday 6:00 am-Noon = A shift
- VasTg6 years agoMemorable Member
Anonymous
Add "Date.DayOfWeek([Column1])" to the condition. It will return 0 for Monday,1 for Tuesday and so on..
If this helps, mark it as a solution.
Kudos are nice too.
- Anonymous6 years agoNot applicable
How to I insert it?
f Time.Hour([END_DATE_TIME])>=7 and Time.Hour([END_DATE_TIME])<16 then "A" else if Time.Hour([END_DATE_TIME]) >=15 and Time.Hour([END_DATE_TIME]) < 23 then "B" else "C"