Date and Time Functions

Introduction

Date and Time functions derive, calculate or convert dates.

Popular date functions include:

  • Current date and time
  • The number of a day, month or year, extracted from a full date (DayNumberOf-)
  • Calculating the last day of a month or year based on a full date (LastDayOf-)
  • Date math (DaysBetween, MonthsBetween)

Popular Date and Time Functions

Note: Many of these functions require the use of two parentheses, but the parentheses remain empty. This is normal.

CurrentDate

Syntax: CurrentDate()

Explanation: This function returns the current date at the time of refreshing. This is useful for noting on your reports when the report was refreshed.

CurrentTime

Syntax: CurrentTime()

Explanation: This function returns the current time at the time of refreshing. This is useful for noting on your reports when the report was refreshed.

DayNumberOfMonth, DayNumberOfWeek, DayNumberOfYear

Syntax: e.g. DayNumberOfMonth(date)

  • date is an object [Object_name] containing only a date or a function which will output a date

Explanation: This function returns the number day number in a month/week/year.

LastDayOfMonth, LastDayOfYear

Syntax: e.g. LastDayOfMonth(date)

  • date is an object [Object_name] containing only a date or a function which will output a date

Explanation: This function returns the last day of in a month/year. This can be useful when trying to match up extract dates from two queries or data sets.

DaysBetween, MonthsBetween

Syntax: e.g. MonthsBetween(first_date;last_date)

  • first_date and last_date are objects [Object_name] containing only a date or a function which will output a date

Explanation: This function allows date mathematics within InfoView, calculating the days or months between two input dates.

Month, MonthNumberOfYear

Syntax: e.g. Month(date)

  • date is an object [Object_name] containing only a date or a function which will output a date

Explanation: This function pulls the month out of a given date. Month will pull the name of the month, MonthNumberOfYear will pull the number of the month.

Example: 12/31/2015

  • Month will show "December"
  • MonthNumberOfYear will show "12"

Year, Week

Syntax: e.g. Year(date)

  • date is an object [Object_name] containing only a date or a function which will output a date

Explanation: This function pulls the year or the number of the week out of the date.

Example: 1/01/2016

  • Year will show "2016"
  • Week will show "1" because it is the first week of the year