Temporally change information in query results??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My query returns a group of 5 projects:
Local
Region1
Region2
Region3
International
Is there a way to change Local so that it shows in the query as Region 1. I
don’t want to change the information in my field. I am hoping that there is
a way to use and If statement or something in the Criteria that will do this
only in the query.
Thanks in Advance
 
Raj said:
My query returns a group of 5 projects:
Local
Region1
Region2
Region3
International
Is there a way to change Local so that it shows in the query as Region 1. I
don’t want to change the information in my field. I am hoping that there is
a way to use and If statement or something in the Criteria that will do this
only in the query.
Thanks in Advance

SELECT IIf(column_name="Local","Region 1",column_name) As Project,
 
MG,
I tried the code you provided but it is not working. I understand the frist
part of the statement but not sure where the actually change take place..
Thanks
 
Raj said:
MG,
I tried the code you provided but it is not working. I understand the frist
part of the statement but not sure where the actually change take place..
Thanks

:

Syntax on IIf() function:

IIf(<expression>, <true expression>, <false expression>)

Translation: If the <expression> evaluates to True, use the <true
expression>; otherwise, use the <false expression>.

Therefore, my example would translate to this:

If the column that holds the Local, Region1, Region2, etc., holds the
word "Local," display the words "Region 1" instead; otherwise, display
the value that is in the column. Use the alias "Project" as the column
name in the SELECT clause. Continue with the rest of the SELECT clause
and the rest of the SQL statement.
 
Back
Top