Date2ANSISQLStr Function
Returns Date as a string suitable for ANSI Standard comparisons, ie { d 'YYYY-MM-DD' }

Unit
QESBPCSDateTime

Declaration
Function Date2ANSISQLStr(const DT: TDateTime): string;

Parameters
DT Date to process.

Category
Date/Time Conversion Routines

Implementation

function Date2ANSISQLStr (const DT: TDateTime): string;
var
     Day, Month, Year: Integer;
begin
     try
          OptDecodeDateI (DT, Year, Month, Day);
          Result := '{ d ''' + Int2ZStr (Year, 4) + '-' + Int2ZStr (Month, 2)
               + '-' + Int2ZStr (Day, 2) + ''' }';
     except
          Result := '';
     end;
End;


HTML generated by Time2HELP
http://www.time2help.com