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
 Case Statement Date Logic

Author  Topic 

wsilage
Yak Posting Veteran

82 Posts

Posted - 2013-03-08 : 09:59:54
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

52326 Posts

Posted - 2013-03-08 : 10:03:20
[Future date] > DATEADD(mm,4,GETDATE())

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

Go to Top of Page

wsilage
Yak Posting Veteran

82 Posts

Posted - 2013-03-08 : 11:52:08
Thank you!
Go to Top of Page
   

- Advertisement -