By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,830 Members | 682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,830 IT Pros & Developers. It's quick & easy.

Query Results Don't Match Data

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a


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 discussion thread is closed

Replies have been disabled for this discussion.