SQL - Scalar functions - THIS_WEEK


Volta a página anterior

Volta ao Menu das scalar functions

Volta ao Menu Principal


Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

THIS_WEEK

The THIS_WEEK function returns the first day of the week that contains the specified date.
Sunday is considered the first day of that week.

THIS_WEEK(datetime-expression )

The schema is SYSIBM.

datetime-expression
An expression that specifies a date for which first day of the week is to be returned.
The expression must return a value that is a DATE, a TIMESTAMP, a CHAR, or a VARCHAR data type.
In a Unicode database, the expression can also be a GRAPHIC or VARGRAPHIC data type.
CHAR, VARCHAR, GRAPHIC, and VARGRAPHIC are supported using implicit casting.
If datetime-expression is a CHAR, VARCHAR, GRAPHIC, or VARGRAPHIC data type, it must be a valid string accepted by the TIMESTAMP scalar function.

This function returns a value of data type DATE.
If the argument can be null, the result can be null.
If the argument is null, the result is the null value.

Example

      values this_week ('1996-02-29')
      Result: 1996-02-25

© Copyright IBM Corp.