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 |
|
jrahma
Starting Member
16 Posts |
Posted - 2007-08-25 : 13:00:31
|
| Hi,I want to know how can i query from sql server date field without the time? i mean if i have the following dates:8/22/2007 12:00:00 AM8/22/2007 12:23:00 AM8/22/2007 04:15:00 PMand i want to SELECt all the 8/22/2007 dates..how can i creates such stored procedure? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-25 : 16:03:01
|
CREATE PROC dbo.uspTest(@theDate AS DATETIME)ASSELECT *FROM Table1WHERE Col1 >= DATEADD(DAY, DATEDIFF(DAY, 0, @theDate), 0)AND Col1 < DATEADD(DAY, DATEDIFF(DAY, 0, @theDate), 1) E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|