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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Finding records with a Date being within 15 days

Author  Topic 

swims01
Yak Posting Veteran

59 Posts

Posted - 2009-04-30 : 17:21:55
You all have been a big help so I'm going to keep going with asking questions here =)

I have a table that tracks a Start Date and Cancel Date. I'd like to find records that have a Cancel Date less than or equal to 15 days of the Start Date.

select * from tbl where canceldate <= (startdate + 15 days)

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-04-30 : 17:26:57
datediff(day,startdate,enddate)


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

swims01
Yak Posting Veteran

59 Posts

Posted - 2009-04-30 : 17:28:36
Never mind. I got it =)

edit* thanks! that's what i tried and lo and behold, it worked!
Go to Top of Page
   

- Advertisement -