pdate()

Read(236) Label: the first day, the last day,

Description:

Get the first day and the last day of the week/month/quarter to which a date belongs.

Syntax:

pdate (dateExp)

Note:

The function gets the first day and the last day of the week/month/quarter to which the date dateExp belongs.

Parameters:

dateExp    Expression whose result is a date, or of standard date format

Options:

@w

Get the Sunday of the week to which the specified date belongs

@we

Get the Saturday of the week to which the specified date belongs

@m

Get the first day of the month to which the specified date belongs

@me

Get the last day of the month to which the specified date belongs

@q

Get the first day of the quarter to which the specified date belongs

@qe

Get the last day of the quarter to which the specified date belongs

The default is to get the Sunday of the week to which the specified date belongs

@y

Get the first day of the year to which the specified data belongs

Return value:

Datetime type

Example:

pdate@w(datetime("19800227","yyyyMMdd"))

1980-02-24

pdate@we (datetime("19800227","yyyyMMdd"))

1980-03-01

pdate@m(datetime("19800227","yyyyMMdd"))

1980-02-01

pdate@me(datetime("19800227","yyyyMMdd"))

1980-02-29

pdate@q(datetime("19800227","yyyyMMdd"))

1980-01-01

pdate@qe(datetime ("19800227","yyyyMMdd"))

1980-03-31

pdate@y(datetime("19800227","yyyyMMdd"))

1980-01-01