Simple Query problem ... please help

zkosky

Board Regular
Joined
Apr 13, 2004
Messages
60
My table (called tbl_Job_Asset_Emp) is as below.
4155_HW6_MAS_Data.xls
ABCDE
1JobNumberAssetTypeEmpDeptNo
21001110
31001112
41002232
51002234
61003340
71003345
81004452
91004454
101005580
111005780
Job_Asset_Emp
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Re: Simple Query problem ... please help -- APPEND1

My Second Table (called tblTotal_Pay_per_Dept) is as follows:<SCRIPT language=JavaScript

src="http://www.interq.or.jp/sun/puremis/colo/popup.js"></SCRIPT>
4155_HW6_MAS_Data.xls
FGHI
6Emp#DeptTotPay
71011258016
81021058016
91033216974
101043219674.2
111053426076
121064532594.1
131075446412.8
141083415925.2
15109328647.5
161103226096.7
171114037827
181123215062.6
191133217935.2
201141018625.5
211154534893.2
221168049764
231173217166.6
241183417962
251195220083.2
261205437572.1
27121109718.75
281221214247.5
291238044548
301244030572.6
31125329418.2
321264525864
331271236981
34128107159.5
351293416039
361305434067
371315224017.75
381324531118.65
391335447656
401343415682.8
411358033566.4
421361018918
431373219116
441383427516.15
451394530601.8
461403218509.4
471411031356
481424020637
49143458117.2
50144807014
511455412672.8
52146522304.8
53147321688.4
54148341058.4
5514952897.6
5615032767
Job_Asset_Emp



When I run the following query
SELECT tbl_Job_Asset_EmpDept.JobNumber, tbl_Job_Asset_EmpDept.EmpDeptNo,

tblTotal_Pay_per_Dept.DeptNo, tblTotal_Pay_per_Dept.TotPay
FROM tblTotal_Pay_per_Dept, tbl_Job_Asset_EmpDept
WHERE (((tbl_Job_Asset_EmpDept.JobNumber)=1005) AND ((tbl_Job_Asset_EmpDept.EmpDeptNo)=

[tblTotal_Pay_per_Dept]![DeptNo]))
ORDER BY tbl_Job_Asset_EmpDept.JobNumber;

The purpose of my query is to sum the TotPay for each department. It does so accordingly except

it doubles the TotPay for department 80. I will post the results so that you can see it.

Thanks for any help you can give. I've searched the web and have been working on this problem for

the past 6 hours and haven't had much luck.

Thanks again!!
 
Upvote 0
Hi, you might want to re-post the html version of your spreadsheet - it might be too big. Can you include details of the fields included in the tblTotal_Pay_per_Dept?
Andrew :)
 
Upvote 0

Forum statistics

Threads
1,221,829
Messages
6,162,229
Members
451,756
Latest member
tommyw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top