HelpWith SQL

T

TeeSee

Hypothetically my data could contain as follows:
Group 1 and SubGroup 1
Group 1 and SubGroup 2

I would like to have this query produce a unique [Discount] for each
of these combinations or pairings. The following is the standard SQL
and I don't know how and where to introduce the DISTINCT part. Could
someone please enlighten me. Thanks.

SELECT tblMaterialMaster.SISItemCode, tblMaterialMaster.Group,
tblMaterialMaster.SubGroup, tblMaterialMaster.ListPrice,
tblMaterialMaster.Discount
FROM tblMaterialMaster
WHERE (((tblMaterialMaster.ListPrice)>0));
 
J

Jeff Boyce

Try opening a query in design view and clicking on the Totals command
button.

Use GroupBy for [Group] and [SubGroup] fields, and whatever aggregation is
appropriate on the others.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top