Forum Discussion
runnerpaul
10 years agoRegular Visitor
Create Morning/Afternoon columns based on DateTime column
Hi, I have a table with a datetime column called CREATEDDATETIME. I want to use it to create a new column where depending on the time it gets populated with Morning or Afternoon. Anything before ...
- 10 years ago
Hi Paul, you can use the HOUR function in an IF statement to calculate this.
Example:
MorningAfternoon = if((HOUR(TimeTable[CREATEDDATETIME]) <= 12), "Morning", "Afternoon")
Thanks,
Sam Lester (MSFT)
SamLester
10 years agoMicrosoft Employee
Hi Paul, you can use the HOUR function in an IF statement to calculate this.
Example:
MorningAfternoon = if((HOUR(TimeTable[CREATEDDATETIME]) <= 12), "Morning", "Afternoon")
Thanks,
Sam Lester (MSFT)
Anonymous
4 years agoNot applicable
This worked, thank you.