Skip to content

WeekAgo - Built-in Date & Time Function

Purpose

Returns a date and time minus 7 days from the specified date and time.

Syntax

WeekAgo(datetime)

Arguments

Argument Required Description
datetime Yes Any valid datetime expression containing a date

Returns

Variant with date value

See also

Example

// returns Monday, March 25, 2013 00:00:00 PM
Return WeekAgo("01-04-2013")

// returns the time of now minus 7 days with the current time.
Return WeekAgo(Now())

Notes

  • When the argument cannot be converted to a datetime value, a runtime error is generated.
  • WeekAgo returns a datetime variable with the time portion set to 0:00:00 if no time value is given.
  • To print only the date, either format the field (via field properties, choosing NONE for the date portion) or use the FormatDate function.