Dear All
Would you know if there is a formula/function to filter a DATETIME column on the basis of TIME. In other words I would like to filter occurrences of events, everyday, lets say between 2:00 AM and 5PM in last month. The DATETIME format that I have is YYYY-MM-DD HH:MI:SS.
Thank you in advance
Solved! Go to Solution.
Hey @RafalRazny,
This method works:
You just need to separate out the time variable as a time data type and compare that to a string in a time format.
Any questions or issues please ask
Ira Watt
Technical Consultant
Watt@Bulien.com
Within a filter tool, just put this: DateTimeHour([DTField])>2 and DateTimeHour([DTField])<17
Where DTField is the field you are filtering on.
No need for a separate formula.
Just make sure the DTField is a DateTime datatype, otherwise it will likely return a 0 for the hour.
Obviously if you want to include 2AM and 5PM you'd change it to >= and <= in there. 😀
Thank you! I have used the DateTimeHour function in Filter tool and it works well!. Great job @DanielG and @DataNath!