SQL Server Dates and Formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

OK, this has bugged me for years now with SQL Server and Access. I have a
date field entered in SQL server and I am trying to do a query against it.
The format in SQL server is 'dd/MM/yyyy'. Do I really need to prepare my
query to follow this format or is there another way to query dates in
databases without knowing the format in the database?

Thanks
 
Chuck said:
OK, this has bugged me for years now with SQL Server and Access. I have a
date field entered in SQL server and I am trying to do a query against it.
The format in SQL server is 'dd/MM/yyyy'. Do I really need to prepare my
query to follow this format or is there another way to query dates in
databases without knowing the format in the database?

Use parameters instead.

See http://www.pobox.com/~skeet/csharp/faq/#db.parameters
 
Back
Top