<< Click to Display Table of Contents >> Navigation: Available Functions > DToS() |
Syntax
DToS( <DateValue> )
Purpose
To convert a date to a character value of the form "yyyymmdd".
Parameters
<DateValue> may be the name of a date field (such as the .Donation_Date. field), but it may also be any value of Date type -- such as the current date returned by the "Date()" function.
Returns
DToS() returns a character value representation of a date value. The return value is formatted in a way which is appropriate when you wish to use a date field in a sort expression, possibly along with other fields. The standard American date format of (mm/dd/yy) is not appropriate for sorting since dates of this format would be "alphabetized" starting with month, then day, then year. A null (empty) date returns a character value consisting of eight spaces.
Usage
DToS() is a date conversion function that converts a date value to a character value, so that you may combine the date with other character values, usually in an expression used to sort (alphabetize) data.
Example
In a report based on the Donations table, you wish to group by donation date, allowing you to get subtotals for each day. You could do this by entering the following expression for the report Group:
DToS( .Donation_Date. )