- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2017 06:36 PM
Hi Everyone,
Can I compare only datepart of datetime field in query?
We have a scheduled solution date field in incident management.
We want to send a notification e-mail to the owner of the incident scheduled to be resolved at next day in schedule job .
It is coded in the script as follows.
-----------------------
var todaysDate = gs.nowDateTime.split(' ')[0];
var gr = new GlideRecord('u_sys_itsm_incident');
gr.addQuery('active', true);
gr.query();
while (gr.next()) {
var completedDate = gr.getDisplayValue('u_response_completed_at_scheduled').split(' ')[0];
if (completedDate == todaysDate(-1)
-----------------------
Can I specify this as a query condition?
thanks.
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2017 07:10 PM
Hi Kenji,
how about a encoded query?
sys_created_onONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0),
You could apply filter like that through list view and copy them as encoded queries to your code directly.. Not readable sometimes// but
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2017 07:10 PM
Hi Kenji,
how about a encoded query?
sys_created_onONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0),
You could apply filter like that through list view and copy them as encoded queries to your code directly.. Not readable sometimes// but