Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

WEEK function (ODBC compatible)

Syntax

WEEK ( time_expression )

Description

The scalar function WEEK returns the week of the year as a short integer value (range 1 - 53).

Example

SELECT *

FROM orders

WHERE WEEK (order_date) = 5 ;

Notes

  • The argument to the function must be of type DATE.
  • The argument must be specified in the format MM/DD/YYYY.
  • The result is of type SHORT.
  • If the argument expression evaluates to null, the result is null.

TOCIndex