Thanks Barry,
It worked a treat.
> -----Original Message-----
> From: Barry Lysy [SMTP:blysy@d...]
> Sent: Thursday, October 26, 2000 10:02 PM
> To: sql language
> Subject: [sql_language] Re: sql_language digest: October 25, 2000
>
> Nigel I would try this...
>
> ...create this function in a class module.
>
> Public Function f_GetPriority(intPriority) As String
>
> Select Case intPriority
>
> Case 1
> f_GetPriority = "'System Down'"
>
> Case 2
> f_GetPriority = "'Urgent Response Required"
>
> Case 3
>
> Case 4
>
> Case Else
> f_GetPriority = "Couldn't Find Any Other"
>
> End Select
>
> End Function
>
> .... And then use that function in your SQL statement...
>
>
> SELECT f_GetPriority ([CallNum]) AS CallNumberDesc... FROM ...
>
> HTH
> Barry L
>
> ----- Original Message -----
> From: sql language digest <sql_language@p...>
> To: sql_language digest recipients <sql_language@p...>
> Sent: Thursday, October 26, 2000 12:01 AM
> Subject: sql_language digest: October 25, 2000
>
>
> > SQL_LANGUAGE Digest for Wednesday, October 25, 2000.
> >
> > 1. IIf in an Access Query
> >
> > ----------------------------------------------------------------------
> >
> > Subject: IIf in an Access Query
> > From: "Nigel Parker" <nigel.parker@c...>
> > Date: Wed, 25 Oct 2000 12:27:17 +0100
> > X-Message-Number: 1
> >
> > I am using this variable assignment in MSAccess97 to convert a code
> > reference to it's string meaning using the IIf function.
> > Access doesn't like it, and wont run.
> > Is it because it is too long, or is something wrong?
> > Is there a better or more simple way of acheiving the same thing?
> > Here is the criteria, using the IIf function...
> >
> > CallNum:IIf ([priority]='1','System Down',"& "
> IIf([priority]='2','Urgent
> > Response Required', "&" IIf([priority]='3','Standard Response Required',
> "
> > & " IIf([priority]='4','Advice Required', "&" IIF([priority]='5','Call
> > Dealt With By Desk', "&" IIf([priority]='6','Suspended Call', ''))))))
> >
> > Thanks for any help offered.
> >
> >
> >
> > ---
> >
> > END OF DIGEST
> >