Hi, I am using MS query (in Excel) as my platform. I am trying to create an expression that would say "(if the hour now is after 6AM, then do "A", otherwise do "B" )".
Here is what I cam up with this far:
datepart(hour,getdate()) '(would result in the current hour)'
I tried to modify this a bit:
IIF(datepart(hour,getdate())>6,"A","B")
However, I am getting the following error message:
"Incorrect Syntax near '>'. Statement(s) could not be prepared."
Does anyone have an idea how to fix this?
Thank you very much!
Bookmarks