Date2AccessStr Function
Returns Date as a string suitable for MS Access Date comparisons, ie #MM/DD/YYYY#.

Unit
QESBPCSDateTime

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

Parameters
DT Date to process.

Category
Date/Time Conversion Routines

Implementation

function Date2AccessStr (const DT: TDateTime): string;
var
     Day, Month, Year: Integer;
begin
     try
          OptDecodeDateI (DT, Year, Month, Day);
          Result := '#' + Int2ZStr (Month, 2) + '/' + Int2ZStr (Day, 2)
               + '/' + Int2ZStr (Year, 4) + '#';
     except
          Result := '';
     end;
End;


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