Converting number to Alphabet

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

Guest

Hi,
I got a table as follows:
Yr Eng HR Sales
05 0 0 -1
06 0 -1 0
07 -1 -1 -1

Now while selecting the data I need to show the above as:

NNS
NHN
EHS
Here N is equivalent to 0 while if it is -1 then the value will be either E
or H or S depenidng on which column belongs to. Any help is appreciated.
Thanks.
 
Try this --
SELECT Jack.Yr, IIf([Eng]=0,"N","E") & IIf(
=0,"N","H") &
IIf([Sales]=0,"N","S") AS Expr1
FROM Jack;
 
Assuming all you need to do is display this (as opposed to store it), try a
query like:

SELECT Yr, IIf([Eng], "E", "N") & IIf(
, "H", "N") & IIf([Sales], "S",
"N") AS DisplayData
FROM MyTable
 
Thanks so much for your help Karl and Douglas. I really appreciate it.

Douglas J. Steele said:
Assuming all you need to do is display this (as opposed to store it), try a
query like:

SELECT Yr, IIf([Eng], "E", "N") & IIf(
, "H", "N") & IIf([Sales], "S",
"N") AS DisplayData
FROM MyTable

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Jack said:
Hi,
I got a table as follows:
Yr Eng HR Sales
05 0 0 -1
06 0 -1 0
07 -1 -1 -1

Now while selecting the data I need to show the above as:

NNS
NHN
EHS
Here N is equivalent to 0 while if it is -1 then the value will be either
E
or H or S depenidng on which column belongs to. Any help is appreciated.
Thanks.

 
Back
Top