Date/Time Functions

Function
Name
Description
DATEADD(startdate, numberunits, unit) Add To Date Returns a new Date/Time that adds the specified number of units to the specified starting date value.  e.g.  DATEADD({{mydatefield}}, 6, ‘MM’)   Unit specifiers are:  YY  – whole years  MM  – whole months  DD  – whole days  HH  – whole hours  MI  – whole minutes  SS  – whole seconds
DATEDIFF(startdate, enddate, unit) Difference Between Dates Calculates the total number of minutes, hours, days, months, or years between two date/times.  e.g.  DATEDIFF({{mydatefield}}, now(), ‘HH’)   Unit specifiers are:  YY  – whole years  MM  – whole months  DD  – whole days  HH  – whole hours  MI  – whole minutes  SS  – whole seconds
YEAR(dateval) Year Returns the year portion of the specified date value.  e.g.  YEAR({{mydatefield}})
MONTH(dateval) Month Returns the month portion of the specified date value.  e.g.  MONTH({{mydatefield}})
DAY(dateval) Day Returns the day portion of the specified date value.  e.g.  DAY({{mydatefield}})    Day
HOUR(dateval) Hour Returns the hours portion of the specified date value.  e.g.  HOUR({{mydatefield}})
MINUTE(dateval) Minute Returns the minutes portion of the specified date value.  e.g.  MINUTE({{mydatefield}})
SECOND(dateval) Second Returns the seconds portion of the specified date value.  e.g.  SECOND({{mydatefield}})
DAYWEEK(dateval) Day of Week Returns the numbered week day for the specified date value. Values are 0 through 6 for Sunday through Saturday  e.g.  DAYWEEK({{mydatefield}})
DAYYEAR(dateval) Day of Year Returns the numbered day of the year for the specified date value. Values returned are between 1 and 366.  e.g.  DAYYEAR({{mydatefield}})