Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thank you. I have never said it, but you have a great web site. It is of immense help...."

Geography

Where in the world do Tek-Tips members come from?
FrankMars (TechnicalUser)
9 Aug 12 11:37
I'm a beginner with Access. I have contatenated an equal sign (=) to a field in a query expression, getting a desired result such as "= $50.33". How would I prevent the = sign from showing in null fields?
Thank You in advance.
MajP (TechnicalUser)
9 Aug 12 12:17
string & null = string
string + null = null

so you can do something like
"=" + [fieldName]
instead of
"=" & [fieldName]
FrankMars (TechnicalUser)
9 Aug 12 18:41
Thanks MajP, unfortunately its not working for me. My expression is RateCalc: " = " & [Price]/[SF]. When I replace the & with + I see the null fields blanking out but get a #Error in the other fields in the column.
MajP (TechnicalUser)
9 Aug 12 18:52
Sorry that only works with strings and your value is a currency. This would work
ratecalc: IIf(IsNull([Price]),Null,"= " & [Price])
PHV (MIS)
9 Aug 12 18:54
What about this ?

CODE

RateCalc: IIf(Price Is Null OR Nz(SF,0)=0,""," = " & Price/SF) 

Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

FrankMars (TechnicalUser)
10 Aug 12 11:14
MajP- The code worked fine on the price portion of the formula, the fields with content have the = sign and the fields w/o content have no = sign. But when I divide by the SF field I get the #Error.

PHV- The code worked fine. The result numbers have 13 digits after the decimal. How would I format them with a $ sign and 2 digits after decimal?
MajP (TechnicalUser)
10 Aug 12 12:14
If this is in a query, in design view you can right click on the field and select properties. You can select currency from the Format pulldown.
MajP (TechnicalUser)
10 Aug 12 12:15
oops, strike two. I forgot about the "=" sign so you will have to use a format function.
MajP (TechnicalUser)
10 Aug 12 12:19
Try
RateCalc: IIf([Price] Is Null Or Nz([SF],0)=0,"",Format([Price]/[SF],"= $#.##"))
FrankMars (TechnicalUser)
10 Aug 12 14:14
Thanks MajP, that works good. We've got =,$,digits,and blank null fields. The last challenge for this column is the zero values, which are now reading "= $." Would there be a way for them to be blank?
MajP (TechnicalUser)
10 Aug 12 14:47
Try
IIf(Nz([Price],0)=0 Or Nz([SF],0)=0,"",Format([Price]/[SF],"= $#.##"))
FrankMars (TechnicalUser)
11 Aug 12 14:45
That works good MajP, thanks!

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close