Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

IIf Alias

Posted on 2011-03-23
4
Medium Priority
?
294 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 49

Accepted Solution

by:
Dale Fye earned 1000 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 49

Expert Comment

by:Dale Fye
ID: 35199107
your welcome
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

972 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