Forum Discussion
Anonymous
6 years agoNot applicable
IF Statements For Date and Time
Hello, I am trying to create an IF statement by date and time to associate a shift letter to(A.B,C,D). I have an end date column pulling from a table in this format: 10/21/2019 2:00:00 PM. I...
- 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
VasTg
6 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.
Anonymous
6 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"