Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
In the database I have two date fields I am interested inLead DateRecord As od DateIn this scenerio I am trying to get all leads with lead date of x and return the line item where recordasofdate = Lead Date >= 14 and < 15 days. this will allow me to see the status of the lead 14 days later for all the leads.
Lamprey
Master Smack Fu Yak Hacker
4614 Posts
Posted - 2013-04-26 : 13:54:04
What does this mean? "recordasofdate = Lead Date >= 14 and < 15 days"It really helps if you can post sample data in a consumable format along with expected results. It makes it so we can run queries against your data and you get tested queries. Please see the links below:http://www.sqlservercentral.com/articles/Best+Practices/61537/http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2013-04-29 : 00:35:49
asuuming its a typo and you meant date difference you can do like
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs