ConvertToDate
  • 04 May 2024
  • 1 Minute to read
  • Dark
    Light

ConvertToDate

  • Dark
    Light

Article summary

General

The ConvertToDate function can be used to convert a value to a Date-Time where the time will be set to midnight (beginning of the day).
NOTE

NOTE

If the value cannot be converted to a date-time (e.g. when trying to convert the String "This is a text" to a date-time), the execution of the report document preview or task will fail.

The function can convert text values (i.e. a text representation) and numeric values (i.e. an OLE Date-Time Representation) to dates. Text values can be converted to date when they contain a date in text representation that can be parsed (which depends on the currenctly active culture or regional settings of the server).

Syntax

The syntax of the ConvertToDate function is:

ConvertToDate Funcfion Syntax

ConvertToDate(<value>)

Examples

The following Expression returns the value of the variable vTest of Datasource MyDatasource as Date-Time:

ConverToDate Function Example

ConvertToDate([Datasource].[MyDatasources].[Variable].[vTest])

If the variable contains a String with value "2021-12-30T04:00" then the returned date-time will be December 30th 2021 midnight (beginning of that day).


Was this article helpful?