Changing the format of date and time data

Use the FormatDate function to change date and time information from one format to another. The data type of the column that is selected in the Input column field determines the data type for the output column. For example:

../rule.gif

To change the format of date and time information:

  1. In the Expression Builder, double-click FormatDate in the list of function names. The Function Arguments - FormatDate window opens.

  2. In the Function Arguments - FormatDate window, click the column in the Available columns list that contains date or time information that you want to reformat, then click > to place the selected field in the Input column.

  3. Specify the input format in the Input Format area of the window:

    1. Select a category for the input column data from the Category list.

    2. Select a date, time, or timestamp format from the Format list. The Example list shows an example of the format that you select. The Format string field confirms your selection. You can also specify a format by typing directly in the Format string field.

  4. Specify the output format in the Output format area of the window:

    1. Select a category for the output column data from the Category list.

    2. Select a data or time format from the Format list. The Example list shows an example of the format that you select. The Format string field confirms your selection. You can also specify a format by typing directly in the Format string field.

  5. Click OK. The Function Arguments - FormatDate window closes, and the expression is displayed in the Expression Builder window.

../rule.gif

Related information

Function Arguments - FormatDate window - Fields and controls

Creating SQL statements with SQL Assist