UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Nothing Values in Reports    
 
   
chrcal14
post Oct 13 2009, 10:32 AM
Post #1

New Member
Posts: 18
From: New Castle, PA



There may be no end to my suffering, I clear one hurdle and the next appears immediately.

I got my report to work by making different queries to extract data based on the varying criteria. Then I referenced each query in the control source of text boxes, along with a little bit of math to get the results I want to show.

Works great, except...

It fails wildly when any of the above mentioned fields return "nothing". I say nothing, because they don't return 0, they're just blank. And when they're blank, anything else that references them is also blank. If they have numbers in them, it works.

Example of the code I have in the control source...I tried to use an old Excel trick to get the field to display a 0 with an IIf statement, but that didn't work either...

CODE
=(DSum("[Sum of Volume]","Total Other Oil and Gas Query"))-(DSum("[Sum of Volume]","Total Atlas Query"))-(DSum("[Sum of Volume]","Total Range Query"))-(DSum("[Sum of Volume]","Total Phillips Query"))


I switched to this to try to get around the "Nothing" problem on the Report itself, I was just referencing the text boxes like this...

CODE
=((DSum("[Sum of Volume]","Total Other Oil and Gas Query"))-[Text0]-[Text4]-[Text6])


Again, this works either way, as long as none of the results of the DSum equations are "Nothing".

I guess that's a long way of asking...How do I force a 0 when the query returns "Nothing"?
Go to the top of the page
 
+
tonympls
post Oct 13 2009, 10:58 AM
Post #2

UtterAccess Enthusiast
Posts: 58



try

=nz((DSum("[Sum of Volume]","Total Other Oil and Gas Query")),0)-nz((DSum("[Sum of Volume]","Total Atlas Query")),0)-nz((DSum("[Sum of Volume]","Total Range Query")),0)-nz((DSum("[Sum of Volume]","Total Phillips Query")),0)
Go to the top of the page
 
+
chrcal14
post Oct 13 2009, 11:58 AM
Post #3

New Member
Posts: 18
From: New Castle, PA



Nice!

Now that you put that here I looked up Nz, that's pretty handy.

Thanks so much!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 02:48 AM