Function: DateSubtract

Syntax

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

Description

DateSubtract 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 then 2 weeks before it's last update:

Faceted LessThan(CreatedAt, DateSubtract(LastUpdatedAt, 2w)) { COUNT } WHERE EntityType = Script

See Also

  • No labels