HelpWith SQL

  • Thread starter Thread starter TeeSee
  • Start date Start date
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));
 
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
 
Back
Top