query.DateId

Note:

The content in this help topic pertains to SuiteScript 2.0.

Note:

JavaScript does not include an enumeration type. The SuiteScript 2.0 documentation uses the term enumeration (or enum) to describe a plain JavaScript object with a flat, map-like structure. In this object, each key points to a read-only string value.

Enum Description

Holds the string values for supported date codes in relative dates.

This enum is used to pass the date ID argument to query.createRelativeDate(options). It is also used as the value of the RelativeDate.dateId property. When query.createRelativeDate(options) is called, the enum value that you specify is set as the value of the RelativeDate.dateId property.

When creating a relative date using query.createRelativeDate(options), use the values in this enum to specify a date relative to the current date. For example, to create a relative date that represents the date a certain number of days before the current date, use the DateId.DAYS_AGO enum value. To create a relative date that represents the date a certain number of months after the current date, use the DateId.MONTHS_FROM_NOW enum value.

The values in this enum might look similar to the values in the query.RelativeDateRange enum, but each enum is used for a different purpose:

Module

N/query Module

Sibling Module Members

N/query Module Members

Since

2019.1

Values

Value

Sets RelativeDate.dateId Property To

DAYS_AGO

dago

DAYS_FROM_NOW

dfn

HOURS_AGO

hago

HOURS_FROM_NOW

hfn

MINUTES_AGO

nago

MINUTES_FROM_NOW

nfn

MONTHS_AGO

mago

MONTHS_FROM_NOW

mfn

QUARTERS_AGO

qago

QUARTERS_FROM_NOW

qfn

SECONDS_AGO

sago

SECONDS_FROM_NOW

sfn

WEEKS_AGO

wago

WEEKS_FROM_NOW

wfn

YEARS_AGO

yago

YEARS_FROM_NOW

yfn

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/query Module Script Samples.

            // Add additional code
...
var myRelativeDate = query.createRelativeDate({ dateId: query.DateId.DAYS_AGO, value: 2
});
...
// Add additional code 

          

Related Topics

N/query Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices