These functions are very similar to the date and time functions of Microsoft Excel. You can use these functions to extract dates, calculate the difference between two dates, find the current date and time, and much more.
Following is the list of date and time functions supported in Wyn Enterprise:
Description
The DATE function returns the specified date in the datetime format.
Syntax
DATE(<year>,<month>,<day>)
Parameters
Return Value
A specified date (datetime).
Example
DATE(2012,12,12)
The DATEDIFF function returns the number of units (unit specified in Interval) between the input two dates.
DATEDIFF(<start_date>, <end_date>, <interval>)
The count of interval boundaries crossed between two dates.
DATEDIFF('Sale'[Order Date], TODAY(), DAY)
The DAY function returns a number from 1 to 31 representing the day of the month.
DAY(<date>)
An integer value ranging from 1 to 31.
DAY('Sale'[Sale Date])
The HOUR function returns the hour as a number from 0 (12:00 A.M.) to 23 (11:00 P.M.).
HOUR(<datetime>)
An integer value ranging from 0 to 23.
HOUR('Sale'[Sale DateTime])
The MINUTE function returns a number from 0 to 59 representing the minute.
MINUTE(<datetime>)
An integer value ranging from 0 to 59.
MINUTE('Sale'[Sale DateTime])
The MONTH function returns a number from 1 (January) to 12 (December), representing the month.
MONTH(<date>)
An integer value ranging from 1 to 12.
MONTH('Sale'[Sale Datetime])
The NOW function returns the current date and time in datetime format. The NOW function is useful when you need to display the current date and time on a worksheet or calculate a value based on the current date and time, and have that value updated each time you open the worksheet.
NOW()
A date (datetime).
The QUARTER function returns a number ranging from 1 (January-March) to 4 (October-December) representing the quarter.
QUARTER(<date>)
An integer value ranging from 1 to 4.
QUARTER('Sale'[Sale Date])
The SECOND function returns a number from 0 to 59 representing the second.
SECOND(<datetime>)
SECOND(now())
The TODAY function returns the current date in datetime format.
TODAY()
The WEEKDAY function returns a number identifying the day of the week of a date. The value ranges from 1 (Sunday) to 7 (Saturday).
WEEKDAY(<datetime>)
An integer value ranging from 1 to 7.
WEEKDAY(now())
The WEEKNUM function returns the week number for the given date according to the return_type value. The week number indicates where the week falls numerically within a year.
WEEKNUM(<datetime>,<returnType>)
An integer.
WEEKNUM(now(),1)
The YEAR function returns the year of a date as a four-digit integer in the range 1900-9999.
YEAR(<date>)
An integer in the range 1900-9999.
Year('Sale'[Sale Datetime])