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

"...My thanks to the contributors who freely share their knowledge and enthusiasms. This forum restores some measure of my faith in human nature..."

Geography

Where in the world do Tek-Tips members come from?

need -0.104000000000013 to show as 0 in reportHelpful Member! 

NeilT123 (TechnicalUser)
17 Jul 12 6:39
The query behind my report is returning the result -0.104000000000013 but the text box on the report is blank.

The text box is formatted # with 0 decimal places.

The code in the query is

CODE

K2OBalance: Sum((nz([K2OFromFert])+nz([TotalK2OAppliedByOM])-nz([K2ORemovalsByCrop]))) 

I would like the text box to show 0. How do I do that please?
dhookom (Programmer)
17 Jul 12 11:18
Change the "#" to "0" or "Standard" or something.

Also, I would suggest you provide the second argument when using Nz()

CODE

K2OBalance: Sum((nz([K2OFromFert],0)+nz([TotalK2OAppliedByOM],0)-nz([K2ORemovalsByCrop],0))) 

Duane
Hook'D on Access
MS Access MVP

NeilT123 (TechnicalUser)
18 Jul 12 5:50
Thank you Duane. That worked.

I don't understand the second argument bit so will have to do some reading but I have looked at where I have been using nz elsewhere and have this one which I have tried all ways to add the ,0 but have failed. Can you point me in the right direction

CODE

P2O5FromFert: Sum((nz([P2O5Content]*[ApplicationRate])/1000)) 

Thanks

Neil
Helpful Member!  dhookom (Programmer)
18 Jul 12 13:37
How about:

CODE

P2O5FromFert: Sum((Nz([P2O5Content]*[ApplicationRate],0)/1000)) 

Duane
Hook'D on Access
MS Access MVP

NeilT123 (TechnicalUser)
18 Jul 12 15:23
That works thank you. I was thinking that the ,0 needed to be after the /1000 but of course 0 divide by 1000 is 0.

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