Built-in Functions → weeknum

weeknum() is a scalar date function that evaluates a date expression in the format "yyyy-MM-dd HH:mm:ss" and returns the week number in the year of that date or timestamp.

Signature

weeknum(date exp)

The following table illustrates the weekday() parameter:

ParameterDescription
date expan expression evaluating to a timestamp

Returns

int

Example

weeknum(timestamp("2014-01-01 00:00:00"))

This example returns 1.