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.
Parameter:
dateExp Expression whose result is a date, or of standard date format
Option:
@w |
Get Sunday of the week to which the specified date belongs |
@we |
Get 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 By default, get 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 |