A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

iff function



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2004, 09:03 PM
debdeb
external usenet poster
 
Posts: n/a
Default iff function

I have a table where there are numbers stored for the
values. How do I get those numbers to print out the
corresponding words in a report. Example 1=yes 2=no
3=sometimes. I have the beginning, but how do I put the
rest in.....
Example if field name is Weather,
=IIf([weather]=1,yes)

  #2  
Old April 27th, 2004, 09:20 PM
Rick Brandt
external usenet poster
 
Posts: n/a
Default iff function

"debdeb" wrote in message
...
I have a table where there are numbers stored for the
values. How do I get those numbers to print out the
corresponding words in a report. Example 1=yes 2=no
3=sometimes. I have the beginning, but how do I put the
rest in.....
Example if field name is Weather,
=IIf([weather]=1,yes)


As long as the numeric values go from 1 to whatever and there aren't too
many of them you can use the Choose Function.

=Choose(YourField, "TextIf1", "TextIf2", "TextIf3", etc..)

I don't recall, but I think Choose has a limit though. You can also look
at the Switch() function. While either of these would likely be easier to
build (and debug) then nesting Immediate-Ifs I would actually create a
translation table and join to it in my query if there are more than just a
few choices.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


  #3  
Old April 27th, 2004, 09:46 PM
PC Datasheet
external usenet poster
 
Posts: n/a
Default iff function

Look at the Switch and Choose functions in the Help file. They are more
appropriate than the Intermediate If here.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications

www.pcdatasheet.com


"debdeb" wrote in message
...
I have a table where there are numbers stored for the
values. How do I get those numbers to print out the
corresponding words in a report. Example 1=yes 2=no
3=sometimes. I have the beginning, but how do I put the
rest in.....
Example if field name is Weather,
=IIf([weather]=1,yes)



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.