Functions Language

DatePart

The DatePart() function returns a specific part of a date, such as the day, month, or year.

Related functions: DateAdd


Syntax:

DatePart(Part, Date)
  • In the Quintessence Editor (Studio) using Python language, use: Qx.DatePart()
 See parameter descriptions

PartThe part of the date to return. Valid values include:
doy — day of year
dow — day of week
d — day of month
m — month
y — year
DateAny valid date.

Examples:

The examples provided below are based on fictitious data for illustrative purposes only.

> Example 1: Determine the day of the week for a specific date


Date in question: 13 February 2015

Formula:

return := Datepart("dow", "13 February 2015");

Result:

6