Re: IIf Statement in ADP
From: Ron Weiner (weinNoSpam1_at_mindspring.com)
Date: 02/20/04
- Next message: Patrick Graham: "Referencing Library"
- Previous message: Ling: "Re: Any VBA book rec's, please?!"
- In reply to: Dan M: "IIf Statement in ADP"
- Next in thread: Dan M: "Re: IIf Statement in ADP"
- Reply: Dan M: "Re: IIf Statement in ADP"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 20 Feb 2004 16:40:24 -0500
Yup!
You need to substuite Access's IIF() with SQL's much more versitle CASE()
function
SELECT CASE [tblEmployee].[Terminated]
WHEN -1 THEN 'X'
ELSE ''
END AS Terminated
Above is but one example for using CASE() Take a look at Sql's BOL for more
info.
Ron W
"Dan M" <dannerinoremove@aol.com> wrote in message
news:140e001c3f7ce$842e3410$a501280a@phx.gbl...
> It would appear that using an IIF statement as part of the
> SELECT statement no longer works and is no longer a
> recognized function. Is there a workaround?
>
> In Access 97, I relied on IIF in many list boxes, to
> display the contents of a Yes/No field in a more
> meaningful way. My column would be selected as...
> SELECT IIF([tblEmployee].[Terminated] = -1, "X", "") AS
> Terminated
>
> It displayed a column titled Terminated and displayed an X
> for every employee whose Terminated field was set to true,
> and displayed nothing otherwise. Migrating to XP, using
> an ADP with SQL Server back end, this function seems to be
> illegal. Oh please, tell me there's a way to manufacture
> columns on the fly in a SQL statement.
- Next message: Patrick Graham: "Referencing Library"
- Previous message: Ling: "Re: Any VBA book rec's, please?!"
- In reply to: Dan M: "IIf Statement in ADP"
- Next in thread: Dan M: "Re: IIf Statement in ADP"
- Reply: Dan M: "Re: IIf Statement in ADP"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|