Page 1 of 1
Date settings
Posted: Fri 03 Jun 2005 13:22
by brekhof
I want my program to be able to work with the date format 'dd-mm-yyyy' regardless of the workstation's regional settings. Is there a way to set the format to this for my MSSQL/SDAC components?
regards,
Martin
Posted: Fri 03 Jun 2005 14:13
by Ikar
Usually you shouldn't do anything - Delphi performs all necessary operations automatically.
Posted: Sat 11 Jun 2005 09:20
by maciejw
You can send date to MsSQL (or MSDE) in SQL STRING Format 'YYYYMMDD' which is translated to server for right form regardles of server date format.
f.e. MyQuery: TMsQuery;
MyQuery.SQL.Text := 'SELECT * FROM table_name WHERE date_field = ''19581207''';
MyQuery.Execute;
you receive records where date_field equals tp December 7th 1958.