pday()

Function group Execute on client Platform(s)
Date and Time NO All

Syntax

pday(datepart,date)

Description

Returns the date of the day before the specified date when the datepart constant is set to kDay.

However, if one of the day of the week constants is used, this function returns the date of that day of the week preceding the specified date.

The datepart constants that you can use are: kDay, kSunday, kMonday, kTuesday, kWednesday, kThursday, kFriday, kSaturday.

Example

Calculate lDate as  pday(kDay,#D)
# returns May 7 2003, assume #D is May 8, 2003

Calculate lDate as pday(kThursday,#D)
# returns May 1 2003, which is the Thursday before #D, assume #D is May 8, 2003