473,383 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How do you deal with the result of sum query when there is no data.

I have sales divided into catagories. I query each catagory with a sum query then add the results. If a catagory has no sales I get no results when I add them together. What am I doing wrong? Can I get an empty catagory to return a zero from the sum query?
Feb 11 '11 #1
2 1158
Rabbit
12,516 Expert Mod 8TB
It would help if you post the query. But it sounds like you need to outer join the categories table to the sales table.
Feb 11 '11 #2
NeoPa
32,556 Expert Mod 16PB
The question is very unclear and ambiguous so I'll try to answer what you ask, but if you want more sense you'll probably need to make the question clearer.

It sounds like the result from one of your categories is Null, due to there being no data for that category. If you add a Null value to valid numbers in VBA then naturally the result is Null.

There is a function available (Nz()) to return a valid value if the parameter has one, otherwise a specified default if not. Nz(Null, 0) returns 0. This is a defined and valid value, as opposed to Null, which is neither in this context.
Feb 13 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Girish | last post by:
I need to run a query which will pull data from two tables and append it as one when it displays the result. The data are in two tables. But the result set will be identical in terms of number of...
1
by: ali asjad | last post by:
is there any event that is raised when data in datagrid is changed. actually im using a dataset filled through data adapter and is the data source of datagrid Posted Via Usenet.com Premium...
7
by: Egor Shipovalov | last post by:
I'm implementing paging through search results using cursors. Is there a better way to know total number of rows under a cursor than running a separate COUNT(*) query? I think PostgreSQL is bound...
2
by: A.J.M. van Rijthoven | last post by:
I want to open a form that is based on a query. When the output of the query results in 0 records, I don't want to open the form but just display a messagebox. Is there a way to check if the result...
10
by: Rigs | last post by:
Hi, I have a textbox with a Custom Validator that utilizes the OnServerValidate method for that textbox. This works fine, however the method only executes when data exists in that textbox after...
1
by: Ya Ya | last post by:
I am using the personalization feature in asp.net 2.0 I am storing the phone number for each user. When a certain user enters his phone number I would like to check if another user already...
5
by: veaux | last post by:
I'm thinking this is easy but can't get it. I have a table with following: Table1 Date 1/1/2007 Table2 Type 0107 (This is MMYY of above) So I'm having trouble using a query to turn the...
3
by: gmanoj4u | last post by:
hi all, i am manoj i have a problem with my project ,i need a code to update a mysql query when the browser is automatically closed (in php).kindly suggest me its important for me thank u ..manoj
1
by: jimjack145 | last post by:
Hi All, I have one form with two multi select list box. I want to create query when user select value from it and click for result page. However i search on net but not find any code example....
2
by: MaryKJolly | last post by:
How can I pass a query to Data Report at runtime?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.