Can I compare only datepart of datetime field in query?

chanken
Tera Contributor

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.