SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Case Statement Date Logic
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

wsilage
Yak Posting Veteran

USA
74 Posts

Posted - 03/08/2013 :  09:59:54  Show Profile  Reply with Quote
I have to write some logic regarding a future date column that I have. I am not sure how to write it.

Future date is greater than 4 months older than current date then 'Initial'


This is the statement that I wanted to use, but don't know how to add the date stuff.

Case when t4b_PCST_WHAT = 'CONVRT' and t5_PCST_WHAT = 'RECRED' and Future date is 4 months older than current date Than 'Initial'
Else ''
End

visakh16
Very Important crosS Applying yaK Herder

India
52325 Posts

Posted - 03/08/2013 :  10:03:20  Show Profile  Reply with Quote
[Future date] > DATEADD(mm,4,GETDATE())

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

wsilage
Yak Posting Veteran

USA
74 Posts

Posted - 03/08/2013 :  11:52:08  Show Profile  Reply with Quote
Thank you!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000