StringToDate (PQL)

Converts a string of date into a date value that can be used for subsequent date operations.

  • Returned Output: Date-Time
  • Library: PQL \ Common \ Date-Time
  • Version: 2018.00.000
  • Compatibility:
    • Can be combined with and other PQL function throughout the application.
    • It CANNOT be used with MDX or VBA functions. But it can be used on MDX-based content in other parts of the application.

Syntax

StringToDate( <Text> , OPTIONAL <Mask> )

* Click on the function's arguments above for more details on the input values.

Comments
  • The text string must be a reasonably valid expression of dates.
  • The text mask is an optional input that instructs the engine on how to read the string to construct the date or time.
  • The function produces a date value that can be used with other subsequent functions to manipulate date values.
Different Function types
  • This function is like the Excel DateValue function.
  • Also see the StringToDateTime function. Unlike StringtoDateTime, this method returns date objects only - without the time element.

Examples

This example produce a date-time value for January 5th, 2018

StringToDate("2018-01-05")

This example produce a date-time value for May 1st, 2018

StringToDate("2018-01-05", "YYYY-DD-MM")