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 |
tech_1
Posting Yak Master
129 Posts |
Posted - 2011-08-21 : 12:46:57
|
I have a table with a field "MembershipExpires". this is a datetime value and will contain time.I want to strip out the time and find out where members expire on a given DATEhow would I do this with stripping out the time from the membershipExpires field? |
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-08-21 : 14:10:23
|
Not exactly sure what you're looking for, but the one of these should be helpfuldeclare @date datetimeset @date = getdate()select dateadd(day,datediff(day,0,@date),0),dateadd(day,datediff(day,-1,@date),0)--<< you could use > and <= on these 2select convert(varchar(8),@date,108)-- << looks like a timeJimEveryday I learn something that somebody else already knew |
 |
|
|
|
|