Hello,
I have such a simple question, I feel stupid for asking it. I can't believe I'm hitting my head on this.
I have a table called "Orders". "Orders" has a smalldatetime field called "DateOrdered". I need to get all of the "Orders" on a specific date. I have tried the following without any success:
SELECT * FROM Orders WHERE [DateOrdered]=2010-06-01
SELECT * FROM Orders WHERE [DateOrdered]='2010-06-01'
SELECT * FROM Orders WHERE [DateOrdered]=CAST('2010-06-01' AS smalldatetime)
What am I doing wrong? I can't believe I'm even asking this question.