query.RelativeDate
Object Description |
A relative date to use in query conditions. Use query.createRelativeDate(options) to create this object. After you create this object, you can use it in the This object represents a specific moment in time, and you can use it to create query conditions using operators from the query.Operator enum, such as |
Supported Script Types |
Client and server scripts For more information, see SuiteScript 2.x Script Types. |
Module |
|
Methods and Properties |
|
Since |
2019.1 |
Syntax
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 myEndDate = query.createRelativeDate({
dateId: query.DateId.WEEKS_AGO,
value: 2
});
var myComplexCondition = myQuery.createCondition({
fieldId: 'trandate',
operator: query.Operator.WITHIN,
values: [query.RelativeDateRange.THREE_FISCAL_YEARS_AGO.start, myEndDate]
});
...
// Add additional code