DATE_IN

DATE_IN(values, unit, relative value, first, timezone)

DATE_IN determines if a date, specified by values, is in a time period specified by the  unitrelative value,first, and timezone parameters.

values: Unix time format

unit: day, week, month, quarter, year

relative value: optional, integer; where 0 (default) specifies current year, -1 specifies last year, and so on.

first: optional, days of the week and months of the year. By default, the first day of a week is Sunday and the first month of a year is January. This may be changed, for example, to specify a week starting on Monday or a fiscal year starting in April.

timezone: optional, only needs to be specified if the timezone of the data source differs from the timezone the Klip will display it in. By default, the timezone is GMT.

Note: If you specify the first value, you must also provide a relative value.

For example, for the current month, the relative value is 0.

Examples

DATE_IN( DATE( 26/02/2013, "dd/MM/yyyy" ), year) asks if 26/02/2013 falls in the current year. If today is February 26, 2014, this function returns false because February 26, 2013 does not fall between January 1, 2014 and February 26, 2014.

DATE_IN( DATE( 26/02/2013, "dd/MM/yyyy" ), year, -1) asks if 26/02/2013 falls in the previous year. If today is February 26, 2014, this function returns true because February 26, 2013 falls between January 1, 2013 and December 31, 2013.

DATE_IN( DATE( 26/02/2013, "dd/MM/yyyy" ), year, -1, April) asks if 26/02/2013 falls in the year beginning the April before the previous. If today is February 26, 2014, this function returns true because February 26, 2013 falls between April 1, 2012 and March 31, 2013.

DATE_IN( DATE( 26/02/2013, "dd/MM/yyyy" ), year, -2, July) asks if 26/02/2013 falls in the year beginning the July before the previous 2. If today is February 26, 2014, this function returns false because February 26, 2013 does not fall between July 1, 2011 and June 30, 2012.

Related Links