473,385 Members | 1,912 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,385 software developers and data experts.

How to create a query showing values that are 0

Hey

I've made an outstanding order database for the company I work for. I've created a query which calculates how many are delivered on each job number and how many are outstanding. Using tables -

tblOrders ( This contains order information and assigns the job num which is primary key)
tblDeliveries ( Contains all delivery information linked to orders through job no)

When I run the query only the orders which have been part delivered are displayed, so when the total delivered add to 0 they are not being displayed I think this is because the job numbers are not entered into the deliveries sheet until some are delivered is there way round this?? I'm bit rusty with databases haven't used them for years!!!

Thanks
Jul 2 '10 #1

✓ answered by NeoPa

Well, the first thing I notice is that all the JOINs are INNER JOINs (See SQL JOINs). This means that if a related record is missing from any of the matching tables or queries then it will not appear in the output. Can you check for any missing values that they actually appear in all of the related tables and queries. If they do then we may need to look again, but I suspect this is your problem.

5 1548
NeoPa
32,556 Expert Mod 16PB
There could be many reasons. Why don't you start by posting the SQL of the query you're running and we can see what may be a solution.
Jul 2 '10 #2
SQL View -
Expand|Select|Wrap|Line Numbers
  1. SELECT Customer.[Customer Code]
  2.       ,Orders.[SK Works no]
  3.       ,Orders.[Order No]
  4.       ,Product.[Product Description]
  5.       ,Orders.[Qty Ordered]
  6.       ,[Total Delivered on work no].[Line Item Totals]
  7.       ,[How Many outstanding qry].Outstanding
  8.  
  9. FROM   Customer INNER JOIN 
  10.        (((Product INNER JOIN
  11.        Orders
  12.   ON   Product.[Product Code]=Orders.[Product Code]) INNER JOIN
  13.        [How Many outstanding qry]
  14.   ON   Orders.[SK Works no]=[How Many outstanding qry].[Sk Works No]) INNER JOIN
  15.        [Total Delivered on work no]
  16.   ON   Orders.[SK Works no]=[Total Delivered on work no].[Sk Works No])
  17.   ON   Customer.[Customer Code]=Product.[Customer Code]
  18.  
  19. WHERE  (((Customer.[Customer Code])=[What customer?]))
Jul 2 '10 #3
NeoPa
32,556 Expert Mod 16PB
Well, the first thing I notice is that all the JOINs are INNER JOINs (See SQL JOINs). This means that if a related record is missing from any of the matching tables or queries then it will not appear in the output. Can you check for any missing values that they actually appear in all of the related tables and queries. If they do then we may need to look again, but I suspect this is your problem.
Jul 2 '10 #4
Thanks for your help all working as it should now
Jul 5 '10 #5
NeoPa
32,556 Expert Mod 16PB
I'm very pleased to hear it :)

Welcome to Bytes!
Jul 5 '10 #6

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

Similar topics

2
by: Irmen de Jong | last post by:
Hello I've got a nuisance with the cgi module. (Python 2.3.2) When processing a HTTP POST request, it ignores the query string parameters that may also be present. I.e. only the parameters from...
8
by: jy836 | last post by:
I have been working on an application, which to this point has only involved one Windows Form. I need to create another one; but on the Project menu, there are two options: "Add Windows Form" and...
2
by: Zlatko Matić | last post by:
Hello. How to reference selected values from a multi-select list box, as a criteria in a query ? Is it possible at all? Regards, Zlatko
4
by: keithb | last post by:
A page uses query string values to add a record to a database. The record should be added only once; however, if a user activates the url additional times, multiple records are added. Is there some...
0
by: JDC | last post by:
Hi all I have a GridView template field with two DropDownLists in the Edit Template. The first DropDownList is populated with a fairly standard databinding: <asp:DropDownList...
5
by: Kaspa | last post by:
I am creating a contact database and I would like the user to create his own groups of contacts based on criterias, thefore I would like to let him pick the fields and criteria for a particular...
2
by: brob | last post by:
I am Access newbie looking for some guidance in putting together a query that can output a table of max values in a given column grouped by a couple of other columns. Here is an example of what I...
6
by: xian2 | last post by:
Hi All, I have created a query with 6 related tables as the record source. The query includes 4 fields from 4 of the tables: tblTourBookings TourStartDate tblAdditionalCosts
7
IGGI
by: IGGI | last post by:
Looks like this is the best place for the right Answers. Got a database that stores users skills, "Leader", "Investigator","Engineering" ect in a "personnel" table, A form called "Search Query"...
2
by: MyGreatProgramme | last post by:
I want to make a delete query that deletes all the items that are in the minorty. For example, in the field " Houses " there are 10 rows with value 1 , 3 rows with value 3 and 4 rows with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.