Date Formatting

DADE handles date formatting in two phases:

User entry

This occurs when the user specifies a date using the Query tools or the AutoSearch dialog. DADE converts the date string entered by the user into a Delphi TDateTime value. The string entered by the user is converted using Delphi’s StrToDateTime. By default Delphi’s StrToDateTime relies on the date formatting variables for the current windows locale. These can be overridden by the developer. See Delphi online help for StrToDateTime for more information.

SQL submitted to the server

When generating the SQL to be submitted to the database server, DADE converts the TDateTime value from number 1 above, to a string using the Delphi’s FormatDateTime function. The format string used to convert the TDateTime is specified by the TdaSession.GetSearchCriteriaDateFormat¬† and TdaSession.GetSearchCriteriaTimeFormat functions. These are virtual methods which may be overridden by descendant TdaSession classes.

Below are the default values returned.

Note: DADE augments the above with additional formatting delimiters for Oracle and MSAccess. See TdaSQL.ResolveCriteria located in RBuilder\Source\daSQL.pas for more information.