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 |
satheesh
Posting Yak Master
152 Posts |
Posted - 2011-01-28 : 08:26:15
|
Hi allThis query returns the bellow error msg.select * from cst where (cst.cstStartDate between 'getdate()- 330' and 'getdate()-370')Conversion failed when converting date and/or time from character string.I need to get the data within this range from today.Pls Help.. |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-01-28 : 08:31:27
|
Remove the single quotes. No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-01-28 : 09:54:07
|
Not only single quote, but this tooselect * from cstwhere (cst.cstStartDate between getdate()- 370 and getdate()-330)MadhivananFailing to plan is Planning to fail |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-01-28 : 10:06:11
|
Alright madhi the eagle eye No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-02-01 : 04:43:01
|
quote: Originally posted by webfred Alright madhi the eagle eye No, you're never too old to Yak'n'Roll if you're too young to die.
MadhivananFailing to plan is Planning to fail |
|
|
GCoe
Starting Member
1 Post |
Posted - 2011-02-25 : 17:22:09
|
Could you explain why the second select works but the first one does not after the ticks were removed?Thanksg |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|