A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

zero sums



 
 
Thread Tools Display Modes
  #1  
Old April 6th, 2006, 05:16 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default zero sums

I'm confused about the Is Null feature in queries.
I have a query that sums 25 values, val1, val2,val3.... From that i print
out a bar chart in a report that shows the magnitude of these values. I
would like to ignore zero summed values so it fits nicer on the chart. How
would i enter in the code either in SQL or in the criteria of the query?


  #2  
Old April 6th, 2006, 06:49 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default zero sums

Dear SoLah:

After the GROUP BY clause, and before the ORDER BY clause (if any) put in:

HAVING SUM(val1) 0 AND . . .

Does this do it?

Tom Ellison


"SoLah" wrote in message
...
I'm confused about the Is Null feature in queries.
I have a query that sums 25 values, val1, val2,val3.... From that i print
out a bar chart in a report that shows the magnitude of these values. I
would like to ignore zero summed values so it fits nicer on the chart.
How
would i enter in the code either in SQL or in the criteria of the query?




  #3  
Old April 6th, 2006, 06:51 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default zero sums

If you are saying that you don't want to include rows that have nulls in any
of the fields you are summing, you would include all the fields you are
summing in the query, uncheck the "Show" box, and put something like the
following in the criterion beneath each:
Is Not Null

However, if you have a table with fields named something like [Val1] and
[Val2] and [Val3] and ..., you probably have a spreadsheet, not a relational
database. Access provides a very powerful (and very easy) Totals query, but
it only works on well-normalized data. That is, one field with values can
be summed quite easily in an Access Totals query, but you will have to work
quite hard to "sum" a series of fields as your description implies.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"SoLah" wrote in message
...
I'm confused about the Is Null feature in queries.
I have a query that sums 25 values, val1, val2,val3.... From that i print
out a bar chart in a report that shows the magnitude of these values. I
would like to ignore zero summed values so it fits nicer on the chart.
How
would i enter in the code either in SQL or in the criteria of the query?




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Sums Depending on a description. Hanzo Worksheet Functions 9 December 28th, 2005 11:56 PM
Calculating Row and Column Sums in a Crosstab Query van_slanzar Running & Setting Up Queries 1 August 31st, 2005 06:01 AM
Grouping and Sums issue (do it w/ Query or Report?) rgrantz Setting Up & Running Reports 1 December 13th, 2004 02:48 AM
adding and subtracting sums Neal Worksheet Functions 2 September 12th, 2004 09:41 PM
Adding, sums, formulas in Visio AngeP Visio 1 April 30th, 2004 07:53 PM


All times are GMT +1. The time now is 08:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.