Date Add (DateAdd)

Function: DateAdd

Syntax

DateAdd(<FieldName|Function>, <timespan>)

Description

DateAdd allows you to add time to a date value, this can be used to modify values passed to the comparison functions such as GreaterThan

The TimeSpan can be in one of the following formats:

  • hh:mm:ss i.e. 5 minutes would be "00:05:00"
  • N w(eeks), N d(ays), N h(ours), N m(inutes) i.e. "2 weeks", "2d 4h", "5 minutes", "5m" are all valid values.

Examples

Everything where the item was created more than 2 weeks before its last update:

Faceted GreaterThan(LastUpdatedAt, DateAdd(CreatedAt, 2w)) { COUNT } WHERE EntityType = Script

See Also