Sort by based on time

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 03:49 AM
Hi all,
I need to sort queried record based on time in update filed instated of date .
i have tried the below code it is sorting based on date.
var prob = new GlideRecord('problem');
query = "sys_updatedBETWEENjavascript:gs.dateGenerate('" + startDate.getLocalDate() + "','00:00:00')@javascript:gs.dateGenerate('" + endDate.getLocalDate() + "','23:59:59')";
prob.addEncodedQuery(query);
prob.orderBy('sys_updated');
prob.query();
Is there any way to do this
Can anyone help me on this
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 05:04 AM
Hi @Community Alums
The problems are sorted by both date and time when ordering by sys_updated_on.
Do you want to only sort by time and ignore dates?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 05:07 AM