Group by

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have limited experience with Access and need assistance.

I have an shipment table that includes origin zip code, destination zip
code, and ship date. I need to group all shipments that have the same ship
date and same origin-destination zip codes. I need to also know how many
shipments are grouped together.

Thanks
 
SELECT Shipments.ShipDate, OrigZip & " - " & DestZip AS FromTo, Count(OrigZip
& DestZip) AS ShipCount
FROM Shipments
GROUP BY Shipments.ShipDate, OrigZip & " - " & DestZip;

You will need to change the names to match your table and field names.
Copy the code into a text editor, make the appropriate changes.
Create a New Query.
Switch to SQL view.
Paste the code into it.
 
Back
Top