Default language.

Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Check for Db2 13.1.

DAYOFWEEK


The DAYOFWEEK function returns an integer in a range of 1 through 7 that represents the day of the week, where 1 is Sunday and 7 is Saturday.

DAYOFWEEK.png

The expression must return one of the following built-in data types:

  • DATE
  • TIMESTAMP
  • TIMESTAMP WITH TIMEZONE
  • Valid string representation of a date or timestamp with or without a time zone

Important

The expression cannot be specified as a constant.

If the argument can be null, the result can be null; if the argument value is null, the result is the null value.

Example
UNLOAD FORMAT CSV
SELECT EMPLOYEE_NUM, SALARY, DAYOFWEEK(PAYDATE)
FROM SWREGION.ACCTS_PAYABLE              

REORG TABLESPACE SWREGION.APTABLES
DISCARD FROM TABLE SWREGION.ACCTS_PAYABLE
WHERE (DAYOFWEEK(PAYDATE) = 3)

Important

Parentheses are not required when specifying a WHERE clause condition.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*