Multiple Criteria selection

E

Ernest Lai

Hello all I have a lil problem that is racking my brains,

Let's say I have multiple zones, within each zone can be a varying number of
packages. But these packages can arrive at different dates. Something like
the diagram below: (let's hope it shows up properly)

Date 1*
Package A Date 2
Date 3

Zone A Package B Date 1*
Date 2

Package C Date 1*
Date 2
Date 3
Date 4


However I only want the query to show the rows where the date is Earliest
(the stared routes). So I only want to see:

ZoneA - PackageA - Date1
ZoneA - PackageB - Date1
ZoneA - PackageC - Date1

At the moment i see

ZoneA - PackageA - Date1
ZoneA - PackageA - Date2
ZoneA - PackageA - Date3
ZoneA - PackageB - Date1
ZoneA - PackageB - Date2
ZoneA - PackageC - Date1
ZoneA - PackageC - Date2
ZoneA - PackageC - Date3
ZoneA - PackageC - Date4


Thank you very much for reading this far and any help is much appreciated!

Ernest
 
J

John Spencer

SELECT Zone, Package, Min(DateField) as FirstDate
FROM YourTable
WHERE Zone = "A"
GROUP BY Zone, Package

That is a totals or group query.
Open the query grid to a new query
-- Select your table
-- Add your three fields for zone, package, and date
-- Select View: Totals from the menu
-- Change GROUP BY under the Date field to Min
-- Add any criteria you want using the Criteria section.
 

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