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 |
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2010-11-15 : 13:40:31
|
| The date is a datetime that looks like this "2010-11-10 10:28:23.227"So I need to searck on these dates by passing the Stored proc a date like 11/10/2010. How do I do this? Nov 10thDaveHelixpoint Web Developmenthttp://www.helixpoint.com |
|
|
TimSman
Posting Yak Master
127 Posts |
Posted - 2010-11-15 : 13:54:37
|
| Do you care about the time part at all? |
 |
|
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2010-11-15 : 14:04:52
|
| NopeDaveHelixpoint Web Developmenthttp://www.helixpoint.com |
 |
|
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2010-11-15 : 14:28:17
|
| Actually I just need yesterdays date??DaveHelixpoint Web Developmenthttp://www.helixpoint.com |
 |
|
|
TimSman
Posting Yak Master
127 Posts |
Posted - 2010-11-15 : 14:28:30
|
| SELECTcolumnsFROMtableWHERE(CONVERT(date, '11/10/2010') = CONVERT(date, columnname)) |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2010-11-15 : 17:35:34
|
| [code]SELECT *FROM MyTableWHERE MyDateColumn >= '20101110' AND MyDateColumn < '20101111'-- Or to use a parameterSELECT *FROM MyTableWHERE MyDateColumn >= CAST(@MyDateParam AS DATE) AND MyDateColumn < DATEADD(DAY, 1, CAST(@MyDateParam AS DATE))[/code] |
 |
|
|
|
|
|