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 |
|
ntn104
Posting Yak Master
175 Posts |
Posted - 2011-04-01 : 11:05:45
|
| How do I write sql statement to select data of certain date sent (datetime format)for example: where datesent <='2011-04-01-10.44.47.490000'but my statement is not working.thanks, |
|
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2011-04-01 : 11:09:11
|
try this:where datesent <= '2011-04-01 10:44:47.490'Corey I Has Returned!! |
 |
|
|
ntn104
Posting Yak Master
175 Posts |
Posted - 2011-04-01 : 11:11:52
|
I got error message: "The conversion of a char data type to a datetime datatype resulted in an out of range datetime value"The reason I want to select specific time frame since there are two set of data in the same report, run the same date but different time...so I want to select time before 10:44 am to get only data that insert in the table before 10:44 am today.thanks,quote: Originally posted by Seventhnight try this:where datesent <= '2011-04-01 10:44:47.490'Corey I Has Returned!!
|
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
ntn104
Posting Yak Master
175 Posts |
Posted - 2011-04-01 : 11:29:58
|
Thank you, It worked with your statement now. I previouly forget to remove "-" between date and time.quote: Originally posted by Seventhnight try this:where datesent <= '2011-04-01 10:44:47.490'Corey I Has Returned!!
|
 |
|
|
|
|
|