Re: Access to SQL Conversion IIF
From: Adam Machanic (amachanic_at_hotmail._removetoemail_.com)
Date: 09/16/04
- Next message: Louis Davidson: "Re: Call Script from within a script"
- Previous message: Adam Machanic: "Re: FK's and Orphans"
- In reply to: Jay: "Access to SQL Conversion IIF"
- Next in thread: Louis Davidson: "Re: Access to SQL Conversion IIF"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Sep 2004 20:08:54 -0400
Look up CASE in SQL Server Books Online.
"Jay" <j@h.com> wrote in message news:FI42d.48491$mu.11158@okepread07...
> I just upgraded from access to SQL Server. In my access SQL statement
logic
> I used IIF as a work around for a datareport. I needed to fill up a
> different field depending on if a keywork existed. Actually, it was to
> center it as a title. The datareport wouldn't let me bold,center it in
the
> visual basic script code. It just ignored the commands.
> So I used the following SQL logic in access, but it doesn't work in SQL
> Server
>
> SELECT *, IIF(INSTR([Description], '*OPTION') > 0, [Description]) AS
> [OPTIONDesc], IIF(INSTR([Description], '*OPTION') = 0, [Description]) AS
> [OPTIONNonDesc], IIF(INSTR([Description], 'NOTE:') > 0, [SubOrder]) AS
> [SubOrderNOTE], IIF(INSTR([Description], '*EXTRA') > 0, [SubOrder]) AS
> [SubOrderEXTRA],IIF(INSTR([Description], '*NOTE:') = 0, [SubOrder]) AS
> [SubOrder] FROM [EstimateSpecs] ORDER BY [Order]
>
> The error I got was with the IIF statement. Is there something eqivalent
in
> SQL Server version of SQL?
>
> Thank You in advance for any help with this issue!
>
> Thank You!
>
>
>
- Next message: Louis Davidson: "Re: Call Script from within a script"
- Previous message: Adam Machanic: "Re: FK's and Orphans"
- In reply to: Jay: "Access to SQL Conversion IIF"
- Next in thread: Louis Davidson: "Re: Access to SQL Conversion IIF"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|