fabiocardoso 0 Report post Posted August 28, 2005 (edited) How I make a query in SQL Server using a field of the type date?Example: SELECT * FROM Customer WHERE Birth = ' 01/01/1982 'I must use quotes marks same, or exists some another separator for the field of the type date? Edited August 28, 2005 by microscopic^earthling (see edit history) Share this post Link to post Share on other sites
Houdini 0 Report post Posted August 28, 2005 What you have shown SELECT * FROM Customer WHERE Birth = ' 01/01/1982 'is a perfectly valid SQL query that tells the server to retrieve all people from the customer table whose birthday was on 01/01/1982, if there were none that met that criteria then the response would be blank or null becuse no record was found that met the criteria, just for the fun of it to make sure your syntax is right do thisSELECT * FROM Customer WHERE Birth = '*' and it will return all customers just as if you did aSELECT * FROM Customer then you could also do this for age verification of those at least 22 years old bySELECT * FROM Customer WHERE Birth >= ' 01/01/1982 ' Share this post Link to post Share on other sites
yordan 10 Report post Posted August 28, 2005 And also, look what is your database, by simply writingselect Birth from customer ;this will tell you all the birth dates in your database, and you will see whether you had blanks, or wich format your customers used.this is not very different from "select * from customer", but will give you only the Birth column, this should be nicer for diagnostics. Share this post Link to post Share on other sites