DateSerial

Working with MS Access’s date/time type is a total headache. Which goes first the month or the day, or it depends on the values of the month and the day, or maybe on the Regional settings? There’s a medicine for this illness and it’s called DateSerial. Fortunately it works for INSERT as well as SELECT statements so i use this simple function in Delphi deal with date/time.

function DateToSQL(FDate:TDate):String;
begin
  Result := 'DateSerial('+FormatDateTime('yyyy,mm,dd', FDate)+')';
end;

Comments

comments powered by Disqus