Simplicty and flexibility!


Function::DateTime

Year


Parameters


Returns/Result


Examples


Reference

year

Type

Date Function

Purpose

The year function extracts the year from a date value.

Syntax

year( DATE VALUE)

Returns

An integer value from 0 to 99 (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.

If the year function is used on an extended date field or variable, it will return a four digit numeric string from 1776 to 9999.

Examples

year( 12/31/99)

Returns: 99 ( most North American formats)

 

year( 31/12/99)

Returns: 99 ( most European formats)

 

year(99/12/31)

Returns: 99 (parentheses Metric format)parentheses

 

year( DATEFIELD)

Converts the year portion of the value in the DATE field into an integer from 0 to 99 for every record processed. If a record contains the value 12/31/99 in the DATE field, the function returns 99.

See Also


On the forum about Year

Help Rewriting after 25 years on 5.53 Dos

[@EOF@]...

Product: Dataease [{8}]FIVE. Written by Graham Brown 15/02/13 at 16:55:14

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

Function year - differences between 6.52 - 8

I notice that the funcion Year(current date) works in different way in dataease 8. (or post 6.52) I mean if I try to run this DQLmessage year (current date) window.In dataease 8</str...

Product: Dataease [{8}]FIVE. Written by Marco Marchesi 11/03/14 at 09:41:46

Re:Function year - differences between 6.52 - 8

Marco,Easy way around this : message lastc (current date,2) window.Using lastc as above instead of year will pull the last 2 characters from the date field.Incidently I can't get year(field) ina&nbsp; DQL t...

Product: Dataease [{8}]FIVE. Written by Simon B 12/03/14 at 12:38:06

Problems with getting the correct year from year()

Hi silly quick question. I want the year from a date field '15' at the moment it is giving me 20 as in 2015...

Product: Dataease [{8}]FIVE. Written by Dave C 15/08/15 at 09:30:48

Re:Problems with getting the correct year from year()

lastc(year(date),2)Year() return a 4 digit year i.e. 2015 and as all return values are treated as text in conversion that will be read from left to right when you convert it to two digits.So if you only want the last to digits you need...

Product: Dataease [{8}]FIVE. Written by DataEase 15/08/15 at 09:35:10

Happy New Year! 2016

Happy New Year!Wish you all bright and happy&nbsp;2016....

Product: Dataease [{8}]FIVE. Written by Jeyarajah Arulrajah 31/12/15 at 23:13:36

Re:Happy New Year! 2016

Happy New Year !All the best and best health and much peace everywhere !!!!!Marku...

Product: Dataease [{8}]FIVE. Written by grohmann.papier@t-online.de 01/01/16 at 11:04:45

Re:Re:Happy New Year! 2016

Hapy New Year everyone and we can promise here from DataEase HQ that it will be an even more exciting DataEase year than the one we just left.Happy New Year!...

Product: Dataease [{8}]FIVE. Written by DataEase 01/01/16 at 12:11:31

On the blog about Year


dg3_HelpView