Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
UNKNOWN
Panel
bgColorwhite

WEEKNUMBER


This function returns Returns the week number within the year of a given date or dateTime value. The week number is returned as an integer in the range 1 - 53. Week 1 for a year is the earliest seven day period starting at Monday that contains at least 4 days from that year. This definition reflects the ISO 8601 Week dates definition.

For example, January 1, 2015 was a Thursday. Therefore week 1 of 2015 starts on December 29, 2014, and ends on January 4, 2015.


Syntax

Code Block
WEEKNUMBER ( date | dateTime )


Inputs

  • date or dateTime - The date or dateTime value of which the week number must be returned.


Return type

  • integer


Examples

ExpressionResultType
WEEKNUMBER ( DATE ( 2015 , 01 , 01 ) )1Integer
WEEKNUMBER ( DATETIME ( 2014 , 12 , 28 , 0 , 0 , 0 ) )1Integer
WEEKNUMBER ( DATE ( 2015 , 12 , 28 ) )53Integer
WEEKNUMBER ( DATE ( 2016 , 01 , 02 ) )53Integer
WEEKNUMBER ( DATETIME ( 2016 , 01 , 04 , 0 , 0 , 0 ) )1Integer

Back to top

Panel
bgColorwhite

DAYOFWEEK

This function returns the number of the day within the week of a given date or dateTime value, as follows:
Sunday =
1
  • Monday = 2
  • Tuesday = 3
  • Wednesday = 4
  • Thursday = 5
  • Friday = 6
  • Saturday = 7
  • Syntax
    Code Block
    DAYOFWEEK ( date | dateTime )
    Inputs
    • date or dateTime - The date or dateTime value of which the week number must be returned.
    Return type
    • integer
    Examples
    ExpressionResultType
    DAYOFWEEK ( DATE ( 2015 , 01 , 01 ) )5Integer
    DAYOFWEEK ( DATETIME ( 2015 , 12 , 28 , 0 , 0 , 0 ) )2Integer
    DAYOFWEEK ( DATE ( 2016 , 01 , 02 ) )7Integer
    DAYOFWEEK ( ? )
    Integer


    Back to top