Returns a Character-type date from a Date or DateTime expression.
DTOC(dExpression | tExpression [, 1]) |
Parameters
- dExpression
-
Specifies a Date-type variable, array element, or field for which DTOC( ) returns a Character-type date.
- tExpression
-
Specifies a DateTime-type variable, array element, or field for which DTOC( ) returns a Character-type date.
- 1
-
Returns the date in a format suitable for indexing. This is particularly useful for maintaining the table records in chronological sequence.
For example, to order table records in entry sequence, you could issue this command:
Copy CodeINDEX ON DTOC(gdInvDate, 1) + gnInvTime TAG Timeindx
gdInvDateandgnInvTimeare fields containing the date and time when the data was entered in the record.
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08