Todate

Converts date strings to numbers that can be used in calculations.

Syntax

Todate ( string_value_expression_1 ,string_value_expression_2 )
ParameterDescription

string_value_expression_1

The format of the date string, either "mm-dd-yyyy" or "dd-mm-yyyy" (must be in lower case).

string_value_expression_2

The date string.

Notes

Example

For products introduced before 06.01.1996, the following query calculates a Revised Budget that is 110% of Budget.

WITH MEMBER
 [Scenario].[Revised Budget]
AS
 'IIF (
       [Product].CurrentMember.[Intro Date] 
        > TODATE("mm-dd-yyyy","06-01-1996"),
        Budget * 1.1, Budget
      )'
SELECT
 {[Scenario].Budget, [Scenario].[Revised Budget]}
ON COLUMNS,
 [Product].[200].Children 
 DIMENSION PROPERTIES [Intro Date]
ON ROWS
FROM Sample.Basic
WHERE ([Measures].[Sales], [Year].[Qtr3])

This query returns the grid:

Axis-1Axis-1.propertiesBudgetRevised Budget
200-10(Intro Date = 09-27-1995, type: TIME, )1106011060
200-20(Intro Date = 07-26-1996, type: TIME, )968010648
200-30(Intro Date = 12-10-1996, type: TIME, )38804268
200-40(Intro Date = 12-10-1996, type: TIME, )26602926