Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if null 1

Status
Not open for further replies.

nike2000

Technical User
Apr 1, 2003
61
GB
Hi, I have a field in a table that contains one of the follwoing data. The data is O, M and it can be null.
The name of the field is 'Analytic Direction'.

Depnedant on the criteria of the field I would like to display more identifiable values for each one.

They are:

O = Original
M = Mirror
If it is Null Standard

What is the code for the If statement?
Thanks,
Nike

 
Hi

O = Original
M = Mirror
If it is Null Standard

IIF(IsNull(MyCol),"Standard",IIF(MyCol="O" , "Original","Mirror"))

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
As usual, Ken's solution is spot on, as they say, and will suffice for your needs. There is another option which may be easier when there are more possibilities. If you find yourself decoding half a dozen or more choices, the SWITCH function is easier to deal with.

The function works by examining a list of values, and decoding the match to another value. For example, consider a list of a few states:

Switch([ST]="NJ", "New Jersey", [ST]="PA", "Pennsylvania", [ST]="NY", "New York", [ST]="DE", "Delaware", [ST]="MD", "Maryland") and so on...

You can think of SWITCH as a big long If..Then..Else statement that's a bit easier to deal with.

Just a thought...





If at first you don't succeed, skydiving probably isn't for you!
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top