Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-06-27 : 12:28:32
|
| Hi,I am using MS SQL Server 2008 and I would like to query a table for a date. (27/06/2011)How can I query as follows?Select * from table1 where mydate = 27/06/2011Best Regards. |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2011-06-27 : 12:31:33
|
need ' marks:Select * from table1 where mydate = '27/06/2011'Corey I Has Returned!! |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-06-27 : 13:00:00
|
I would prefer WHERE mydate = '20110627' No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
Dasman
Yak Posting Veteran
79 Posts |
Posted - 2011-06-27 : 14:24:59
|
| You can also try SQL's IN Operator.SELECT *FROM table_nameWHERE column_name IN (value1,value2,...)Dasman==========================Pain is Weakness Leaving the Body. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|