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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need -0.104000000000013 to show as 0 in report 1

Status
Not open for further replies.

NeilT123

Technical User
Jan 6, 2005
302
GB
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?
 
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][red][b],0[/b][/red])+nz([TotalK2OAppliedByOM][red][b],0[/b][/red])-nz([K2ORemovalsByCrop][red][b],0[/b][/red])))

Duane
Hook'D on Access
MS Access MVP
 
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
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top