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¶
- Date
- DateAdd
- DateDiff
- DatePart
- DateSerial
- DateValue
- Day
- Hour
- InAgedToDays
- InLast4WeeksToSunday
- InLast7Days
- InLastFullMonth
- InLastFullWeek
- InLastYearMTD
- InLastYearYTD
- InLeapYear
- Minute
- Month
- MonthName
- Now
- Second
- Time
- TimeSerial
- TimeValue
- Weekday
- WeekdayName
- Year
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.