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
 How would I write this?

Author  Topic 

JJ297
Aged Yak Warrior

940 Posts

Posted - 2009-02-24 : 13:32:45
If sysdate - App_Rcpdt is null then us DowrRcpdt?

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-24 : 13:34:51
[code]Coalesce(column,DowrRcpdt)[/code]
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-24 : 13:34:57
SET @Var=CASE WHEN DATEDIFF(dd,App_Rcpdt,GETDATE()) IS NULL
THEN DowrRcpdt
END

where @var is variable to which value is to be assigned
Go to Top of Page

JJ297
Aged Yak Warrior

940 Posts

Posted - 2009-02-24 : 13:50:48
Thanks that worked!
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-25 : 09:09:42
welcome
Go to Top of Page
   

- Advertisement -