dbTalk Databases Forums  

More Query help !

comp.database.ms-access comp.database.ms-access


Discuss More Query help ! in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
What-a-Tool
 
Posts: n/a

Default More Query help ! - 09-24-2003 , 07:55 PM






Have a Table similar to the following:

Col 1 Col2 Col3
Part Number Description Count

A5 LD 10000
A6 B 15000
A6 B 2600
A6 LD 50000
A6 LD 20000
A7 B 102000
B12 D 35000
B12 D 20000
B12 B 3000
T34 H 2000
T34 B 75000
T34 H 65000

I want to do a query that would give me total counts for each item that has
matching part number and description

A5 _LD = 10000
(A6_ B) +( A6 _ B) = 17600
(A6_LD) +( A6_LD) = 70000
ect...

Can this be done in a query? Being just an Access Amatuer, I can't see how.
I have added calculated and concatenated columns, but my methods for that
won't work here.
Could someone help please?
Thanks - Sean





Reply With Quote
  #2  
Old   
Bradley
 
Posts: n/a

Default Re: More Query help ! - 09-24-2003 , 08:15 PM






"What-a-Tool" <FrigginSpammersDieDieDie!@cox.net> wrote

Quote:
Have a Table similar to the following:

Col 1 Col2 Col3
Part Number Description Count

A5 LD 10000
A6 B 15000
A6 B 2600
A6 LD 50000
A6 LD 20000
A7 B 102000
B12 D 35000
B12 D 20000
B12 B 3000
T34 H 2000
T34 B 75000
T34 H 65000

I want to do a query that would give me total counts for each item that
has
matching part number and description

A5 _LD = 10000
(A6_ B) +( A6 _ B) = 17600
(A6_LD) +( A6_LD) = 70000
ect...

Can this be done in a query? Being just an Access Amatuer, I can't see
how.
I have added calculated and concatenated columns, but my methods for that
won't work here.
Could someone help please?
Thanks - Sean
Create a query and click on the Totals button (or View/Totals). This will
show a Total row in your query.
Add the three fields to your query and make Part Number and Description
"Group By" and make the Count "Sum".

The SQL should look something like:

SELECT PartNumber, PartDesc, Sum(Count) AS SumOfCount
FROM tblMyTable
GROUP BY PartNumber, PartDesc;

--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/reponse




Reply With Quote
  #3  
Old   
What-a-Tool
 
Posts: n/a

Default Re: More Query help ! - 09-25-2003 , 07:56 PM



Just wanted to say thanks. Prety basic stuff, I know, - just shows how much
of an amatuer I really am.
Thanks - Sean


"Bradley" <bradley (AT) REMOVETHIScomcen (DOT) com.au> wrote

Quote:
"What-a-Tool" <FrigginSpammersDieDieDie!@cox.net> wrote in message
news:12rcb.10664$0Z5.6178 (AT) lakeread03 (DOT) ..
Have a Table similar to the following:

Col 1 Col2 Col3
Part Number Description Count

A5 LD 10000
A6 B 15000
A6 B 2600
A6 LD 50000
A6 LD 20000
A7 B 102000
B12 D 35000
B12 D 20000
B12 B 3000
T34 H 2000
T34 B 75000
T34 H 65000

I want to do a query that would give me total counts for each item that
has
matching part number and description

A5 _LD = 10000
(A6_ B) +( A6 _ B) = 17600
(A6_LD) +( A6_LD) = 70000
ect...

Can this be done in a query? Being just an Access Amatuer, I can't see
how.
I have added calculated and concatenated columns, but my methods for
that
won't work here.
Could someone help please?
Thanks - Sean

Create a query and click on the Totals button (or View/Totals). This will
show a Total row in your query.
Add the three fields to your query and make Part Number and Description
"Group By" and make the Count "Sum".

The SQL should look something like:

SELECT PartNumber, PartDesc, Sum(Count) AS SumOfCount
FROM tblMyTable
GROUP BY PartNumber, PartDesc;

--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/reponse





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.