Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

IIf Alias

Posted on 2011-03-23
4
269 Views
Last Modified: 2012-05-11
Hello,
I have a bunch of fields that are requiring "N/A" if the end user hasn't entered any data.  The code I'm using for the source is as follows.
=IIf([Close Date]<=0,"N/A",[Close Date])

Now, this works for numbers but not for text entries.  How can I edit this code to work for text entries?
0
Comment
Question by:napsternova
  • 2
4 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
ID: 35198665
Try the NZ() function.

=NZ([Close Date], "N/A")

This will work if no data has ever been entered, but if data was entered, saved, and then deleted, it probably won't.  In that case, you might try:

= IIF(LEN([Close Date] & "") = 0, "N/A", [Close Date])
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 35198728
first, you have to set the Data type of the field to Text, if it is not set as Text.
0
 

Author Closing Comment

by:napsternova
ID: 35198755
Easy as pie.  Thank you soooo much!
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 35199107
your welcome
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question