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
 45 days from TODAY?

Author  Topic 

seattletype
Starting Member

4 Posts

Posted - 2011-03-10 : 14:05:13
I need to write a select statement that will return all records where the date field value is 45 days in the future. I don't need the records between now and then... ONLY those that will happen in 45 days. Help?

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-03-10 : 14:09:47
where datefieldvalue = dateadd(day,datediff(day,-45,getdate()),0)

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
   

- Advertisement -