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 |
DeepakNewton
Starting Member
39 Posts |
Posted - 2008-06-18 : 08:00:26
|
Hi All, I have a doubt in checking the two Dates Can i compare like the below statement i just want to compare only dates CONVERT(DATETIME ,'12/31'+ '/' + '2008' ) = CAST (FLOOR(CAST(getdate() float)) As Datetime)Please input ur suggestionsThanksDeepak |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-06-18 : 08:53:07
|
Yes you can.But the comparison is taken out of context. Maybe we'll have a better answer if you provide us full detail of how you are going to use the comparison. E 12°55'05.25"N 56°04'39.16" |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-18 : 09:06:38
|
quote: Originally posted by DeepakNewton Hi All, I have a doubt in checking the two Dates Can i compare like the below statement i just want to compare only dates CONVERT(DATETIME ,'12/31'+ '/' + '2008' ) = CAST (FLOOR(CAST(getdate() float)) As Datetime)Please input ur suggestionsThanksDeepak
Where datecol>=dateadd(day,datediff(day,0,getdate()),0) and datecol<dateadd(day,datediff(day,0,getdate()),1) and MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|