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
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 IIF Statement sql server 2012

Author  Topic 

tech2
Yak Posting Veteran

51 Posts

Posted - 2015-01-27 : 14:44:39
Hi,

I'm having trouble converting the statement below to execute on sql server 2012? It works fine on sql server 2008

,IIF (PODetailInv.DueDate <= GETDATE(), 'LATE', 'PENDING') AS PassDue

I've tried using CASE but can't seem to get it to work.

Thanks for your help.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-01-27 : 14:46:37
Works fine on 2008? IIF is new as of 2012.

What error are you getting?

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-01-27 : 14:47:18
case when PODetailInv.DueDate <= GETDATE() then 'LATE' else 'PENDING' end as PastDue

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

tech2
Yak Posting Veteran

51 Posts

Posted - 2015-01-28 : 09:54:08
Thanks tkizer,

Your conversion worked.

Do you know a Link that explains the conversions from sql server 2008 to 2012?
Go to Top of Page
   

- Advertisement -