I’m looking for a way to filter records by time in a Repeating group
E.g. I would like to display all records created before 9am and after 5pm, the times will be stored and not from a date picker
Thanks in advance for any help!
I’m looking for a way to filter records by time in a Repeating group
E.g. I would like to display all records created before 9am and after 5pm, the times will be stored and not from a date picker
Thanks in advance for any help!
If you want to see it by “today” you can do
Do a search for Records:
where
Created Date < current date time: change hours to 9: rounded down to hour {this will be equal to Today @ 9:00am}
Created Date > current date time: change hours to 17: rounded down to hour {this will be equal to Today @ 5:00pm}
If you want to choose a specific date, such as “last monday” then instead of current date time, use a date picker and then apply the same expression
Thanks and this makes sense, but I’m looking for a way to retrieve records before 9a and after 5p for ANY date
You should be able to do this by extracting minutes/hours from the dates, then filtering based only on those variables.
That was my first thought, but the extract hour operator is not available when I select the Created Date as the field to search, the available operators are >, <, =, <>, is in, isn’t in, etc…
You can do this with advanced filtering (not suggested for performance reasons – advanced filters happen on the client side)
Alternatively, save the time in it’s own field when you save the date field. Save it as Military Time (24H time, to reduce errors). Then your searching will be direct and done on the server.
Field type should be a number so “5:30 pm” should be saved as “1730”.
Then each record should have a time such as 1730 (5:30pm) and make your search much simpler.
Great idea
to do this you need to save the time as numbers and then you can search by number instead of date time
searching by datetime is rather annoying - often I’ll have projects where the client wants to filter by year and month dropdowns - for those I also add dropdowns to the datas as it’s just easier to write the expressions than doing date manipulations (and much less wu)