The Klipfolio DATE_UNITVALUE function retrieves the value of a given unit from the given dates.
The syntax for the DATE_UNITVALUE function is:
DATE_UNITVALUE( values , unit , first, timezone )
The data set
Note: must be in Unix Time format.
second, minute, hour, day, day of week, day of year, week, week of month, month, quarter, year.
Sunday (default), Monday, Tuesday, Wednesday, Thursday, Friday, Saturday.
January (default), February, March, April, May, June, July, August, September, October, November, December.
Note: The day of the week options for first only affect calculations when unit is 'week of month' or 'week'. The month options for first only affect calculations when unit is 'day of year' or 'month' or 'quarter'.
The timezone specified by region or offset.
Let's look at a DATE_UNITVALUE function example.
The following example is based on the above text in an Excel spreadsheet where today's date is 5/16/14:
SELECT( B:B , ( DATE_UNITVALUE( TODAY( ) , day ) = DATE_CONVERT( A:A , "M/d/yy" , "d" )))
Result: Returns the value for today's date.