Hello everyone! I’m making a greeting message that changes based on the time of the day.
My thought process is to use NOW(“”) to get the current date and time, and use GET_DATETIME_COMPONENT(DATE, “hour”) to get the hour. However, the NOW(“”) won’t work with the GET_DATETIME_COMPONENT function.
Would you help me how I can extract “hour” from current time?
May I ask you one more question? I’m trying to make the IF condition to be NOW(“hh”) between 05 and 11. I used && for two conditions to be true, but the formula is not accepting the second “<” (invalid syntax: unexpected “<”
Oh yeah and the note about this relation: <=… < this means that 11:14 would already evaluate to Good Afternoon, however, you might want to tell the user Good Afternoon only after 12, so either has to set the upper limit to “12”, or do this: <= which is the greater than this includes the values up till 11:59.
And so on… Please note that if a formula is more than 4 lines long there might be issues when you click on a different line in the formula editor, so I would suggest using your arrow keys to navigate the formula editor. Also, the highlighting feature helps a lot when trying to figure out which part you are at.
I was about to write this formula as this is the “go with” super simple solution, but I am glad that you have figured it out yourself. That’s the fun part about the journey here. Good luck with the next steps.