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

Query Results Don't Match Data

I am getting two different numbers when I try to total. I am not
getting all my data when I run a query.

Heath
Nov 12 '05 #1
3 2326
Heath wrote:
I am getting two different numbers when I try to total. I am not
getting all my data when I run a query.

Heath


Can you post your SQL here so that we can take a look?

--
'-------------------------------
' John Mishefske
'-------------------------------

Nov 12 '05 #2
Heath Boroff wrote:

SELECT tblDailyWork.dtmDate, tblDailyWork.strEngineer,
tblDailyWork.dblEngineeringHours,
tblChangeNoticeSetup.strEngineeringDescription,
tblDailyWork.strCNNumber, tblChangeNoticeSetup.ysnCNCompleted,
tblChangeNoticeSetup.strProductCode,
tblProductCode.strProductCodeDescription,
tblChangeNoticeSetup.strCategoryCode,
tblCategoryCodes.strCategoryCodeDescription
FROM ((tblChangeNoticeSetup INNER JOIN tblDailyWork ON
tblChangeNoticeSetup.strCNNumber = tblDailyWork.strCNNumber) INNER JOIN
tblCategoryCodes ON tblChangeNoticeSetup.strCategoryCode =
tblCategoryCodes.strCategoryCode) INNER JOIN tblProductCode ON
tblChangeNoticeSetup.strProductCode = tblProductCode.strProductCode;


You are using INNER JOINs for all the tables so only rows with matching
records are returned. There may be records in tblProductCode that have
a strProductCode that isn't found in tblChangeNoticeSetup.

You could try changing that last INNER JOIN to a RIGHT JOIN and see
what happens. I don't know what field you are counting on.
--
'-------------------------------
' John Mishefske
'-------------------------------

Nov 12 '05 #3


I think that that helped. It appears to be working now. Thank you for
the help.

Heath

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bob Bedford | last post by:
I've a query quite important to execute. I've to fill an array with all result, so the query is called once wich returns all ID's Then I call the same query a second time as I shown only 10...
29
by: shank | last post by:
1) I'm getting this error: Syntax error (missing operator) in query expression on the below statement. Can I get some advice. 2) I searched ASPFAQ and came up blank. Where can find the "rules"...
4
by: DBNovice | last post by:
I have a database that keeps records on the issue and failure of an item. Currently, the database is poorly desisned; therefore I'm performing queries to break the data into normalized tables and...
4
by: jimh | last post by:
I'm not a SQL expert. I want to be able to write a stored procedure that will return 'people who bought this product also bought this...'. I have a user table that links to a transaction table...
6
by: Steven D.Arnold | last post by:
I have a query which does not use column indexes that it should use. I have discovered some interesting behaviors of Postgres which may indicate a bug in the database's query planning. Take a...
11
by: Randy Weber | last post by:
I am getting unexpected results with a Like Query using ASP and an Access database. This query - SELECT PN, Qty From Inventory Where PN Like 'SSW-10%'; returns what I expect: PN ...
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
24
by: clare at snyder.on.ca | last post by:
I have a SQL query I need to design to select name and email addresses for policies that are due and not renewed in a given time period. The problem is, the database keeps the information for every...
11
by: Bruce Lawrence | last post by:
Ok, I'm baffled... I'm making a query in access 97 between 2 tables. There is a field in both tables called "DWGNO". OPENORD has a record with a DWGNO of "00000012345" DIEDATA has a record...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
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: 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: 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
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...
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
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.