Simplicty and flexibility!


Function::DateTime

YearWeek


Parameters


Returns/Result


Examples


Reference

yearweek

Type

Date Function

Purpose

The yearweek function calculates the week number (1-53) of a date value.

Syntax

yearweek( DATE VALUE)

Returns

An integer value from 1 to 53 (inclusive). The date format selected in Windows Control Panel changes the date sequence but does not affect which value is returned by a Date function.

Usage

This yearweek function always counts January 1st-7th as Week1, January 8th-14th as Week 2, etc. In a non-Leap Year, the only day in Week 53 is December 31st. In a Leap Year, December 30th is also counted in Week 53 (all dates following February 28 are affected by leap year).

Examples

yearweek( 01/01/99)

Returns: 1

 

yearweek( 12/30/99)

Returns: 52 ( most North American formats)

 

yearweek( 30/12/99)

Returns: 52 ( most European formats)

 

yearweek( 99/12/30)

Returns: 52 (parentheses Metric format)parentheses

 

yearweek( DATE)

Converts the day portion of the value in the DATE field into an integer from 1 to 53, representing the week of the year, for every record processed. If a record contains the value 12/30/96 (a Leap Year) in the DATE field, the function returns 53.

See Also


On the forum about YearWeek

yearweek

I have been using yearweek to find the week number of the current date, and for a time period in 2013. I am not, however, getting the results I expect. The value being returned for yearweek(25/02/14) is 8, however the week number for this...

Product: Dataease [{8}]FIVE. Written by Jason Caldwell 25/02/14 at 10:50:08

Re:yearweek

I believe that the yearweek function always uses January 1st to January 7th inclusive as week 1, no matter which day of the week January 1st falls on.  And therefore 25/02/14 is day 56 (31 + 25) which is in week 8....

Product: Dataease [{8}]FIVE. Written by Peter Birney, PB Associates 01/03/14 at 09:02:02

Re:Re:yearweek

First weekThe ISO 8601 definition for week 01 is the week with the year's first Thursday in it. Mutually equivalent definitions would be possible based on the following properties of this week: It is the first week with a majority...

Product: Dataease [{8}]FIVE. Written by DataEase 01/03/14 at 10:06:51

Re:yearweek

Thank you for the replies.I have found the following in the Dataease documentation, so I believe Peter is correct:The yearweek function always counts January 1st - 7th as Week 1, January 8th - 14th as Week 2 etc. In a non-leap year the o...

Product: Dataease [{8}]FIVE. Written by Jason Caldwell 01/03/14 at 11:56:42

On the blog about YearWeek


dg3_HelpView