How to get the current date records from the table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2015 05:33 AM
Hi Team,
I have a table with date column and I am trying to get the current date records from the table using glide record.
i have used the below code snippet which i have used, but i failed to get the result.
<g:evaluate var="jvar_gr" object="true">
var gr = new GlideRecord("cmdb_ci_outage");
var current_date=new GlideDateTime();
gr.addQuery('begin',current_date);
gr.addQuery('type','outage');
gr.query();
gr;
</g:evaluate>
Can anyone give me solution..
Thanks in Advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2015 06:01 AM
Hi Smitha,
With things like this around dates, I find it easier to add an encoded query. You can go to a list of records, filter the options down to the records you're looking for, then use the query in your encoded query. For example, if I wanted all incidents created on today, I could do:
var inc = new GlideRecord('incident');
inc.addEncodedQuery('sys_created_onONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)');
inc.query();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2015 06:16 AM
Hey Brad,
Thanks for the response , let me try this...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2015 09:16 PM
Thanks Brad , its working ....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2015 05:52 AM
Glad it's working, please mark my reply correct or helpful so it's easier for others to find.