My regional date setting is set to
yyyymmdd
Now, my SQL Server has the default DateTime
setting as
mm/dd/yyyy
My database column has a datatype of DateTime
, and the values it contains are in the same format of the database.
My code is written in Delphi7.
And when it come to fetcch record from the database, it fires a query like given below:
select *
from EMPLOYEE
where JOINING_DATE > '08292017'
In above query, expected date is 08/29/2017
or 08-29-2017
.
In Delphi 7, I'm using GetLocaleChar
method to get the value of separator from the region settings; below is the code for this:
GetLocaleChar(DefaultLCID, LOCALE_SDATE, '/')
where
DefaultLCID := GetThreadLocale;
Another question: does it matter in SQL Server that which separator we are using irrespective of separator used in database column?