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 |
|
richardlaw
Yak Posting Veteran
68 Posts |
Posted - 2011-08-21 : 08:52:11
|
| HiI'm trying to search based on a date using the following:"SELECT * FROM tbl_ClassAbsences WHERE ClassAbsence_Date = 30/08/2011 12:00:00 AM ORDER BY ClassAbsence_AbsentTypeID"But I'm getting errors??? I know the date is right?Any thoughtsThanks as alwaysRichRichard Law |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2011-08-21 : 09:31:39
|
YOu need single quotes around the date string.SELECT * FROM tbl_ClassAbsences WHERE ClassAbsence_Date = '30/08/2011 12:00:00 AM' ORDER BY ClassAbsence_AbsentTypeID |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-21 : 11:43:42
|
| also make sure you pass date formats in iso format (YYYYMMDD) where ever possible to avoid ambiguity. In other case, the system may interpret date wrongly based on what its regional and language settings are.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
iccube
Starting Member
2 Posts |
Posted - 2011-08-22 : 05:21:00
|
| HI You are right Its regional and language settingOLAP |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|