QuerySetAge

Selects batches based on age using a date or number of seconds.

Member of namespace

Maintenance Manager

Syntax

bool QuerySetAge (string age, bool queryAgeStart)

Parameters

age
Type: string
queryAgeStart
Type: bool

Parameters

  • age: All dates prior or within this date will be selected. Smart parameters are supported.
  • queryAgeStart: If True, age will use the start time of the batch. If False, age will use the end time of the batch.

Returns

True if the query has been successfully set. It does not mean the query has been performed. Otherwise, False.

Level

Any level.

Details

Builds a query that selects batches based on the age of a batch. The age can be specified using a date or in seconds. The queryAgeStart parameter determines if the age is based on the start of the batch, the qs_start column, or based on the end of the batch, the qu_done column. If a date is specified, all batches will be selected based on the date. If a number is specified, all batches will be selected based on the number of seconds.

To control the age range use the exclamation point '!'. When the exclamation point is not specified, the age between now and the specified value will be selected. When the exclamation point is specified, the ages that are older than the value specified will be selected.

Example:
QuerySetAge("300","True")
ProcessRunSqlQuery("")

This example selects all batches started within last 300 seconds.

QuerySetAge("!300","true")
ProcessRunSqlQuery("")

This example selects all batches started prior to 300 seconds ago. Use the same pattern when using dates.