Salesforce

DStr (Magic xpa 2.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

DStr (Magic xpa 2.x)

Converts a date or a date expression to a character string, according to a format.

Syntax:

DStr(date, picture)

Parameters:

date: A date

picture: The format of the resulting character string. For a full description, see pictures.

Returns:

Alpha string

Examples:

When the Date Mode environment setting is set to American,
DStr ('01/28/92'Date,'WWWWWWWW, MMMMMMMM DD, YYYY')
returns 'Tuesday, January 28, 1992'

When the Date Mode environment setting is set to European, DStr('28/01/96'Date,'DD/MM/YY')
returns 28/01/96

Note:

You must use the Date Mode environment setting to set the date format, such as:

  • American – MM/DD/YY

  • European – DD/MM/YY

  • Scandinavian – YY/MM/DD

  • Buddhist – DD/MM/YY (YY is the current non-Buddhist date + 36)

The date format that you selected must be reflected in the way you enter the value for the Date literal. For example, if you have selected American for the Date Mode, you must enter the Date Literal value for this function as DStr('01/28/96'Date...). If the DATE Literal value is inconsistent with the Date Mode value, an Invalid Date error appears on the status bar when you use the Syntax Checker.

"Date" following '01/28/92' identifies the string as a Date Literal string, and should not be confused with the Date() function.

See also:

DVal

How Do I Convert a Date Value to a String?

The Online and Rich Client Samples projects (program DT17 and RDT17)

Reference
Attachment 
Attachment