471,599 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,599 software developers and data experts.

SQL to find minimum value for each Distinct record

Hello all,

I have a table looks like this in Access

Product Sale Date
A date
A date
A date
B date
B date
C date
C date
C date

I would like to write a query to find the minimum date (i.e. the date
of the first sale) for each product

Thus, the expected output would be

Product Sale Date
A min date
B min date
C min date

How can i do this using SQL in Access??

any help is greatly appreciated!

Alan

Jun 30 '06 #1
1 4409
1. Create a query using this table.

2.In query design, depress the Total button on the toolbar (upper sigma
icon.) Access adds a Total row to the grid.

3. Drag the Product field into the grid.
Accept Group By in the Total row under this field.

4. Drag the [Sale Date] field into the grid.
In the Total row, choose Min.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<al*********@hotmail.co.uk> wrote in message
news:11**********************@p79g2000cwp.googlegr oups.com...
Hello all,

I have a table looks like this in Access

Product Sale Date
A date
A date
A date
B date
B date
C date
C date
C date

I would like to write a query to find the minimum date (i.e. the date
of the first sale) for each product

Thus, the expected output would be

Product Sale Date
A min date
B min date
C min date

How can i do this using SQL in Access??

Jun 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

67 posts views Thread by PC Datasheet | last post: by
3 posts views Thread by samdev | last post: by
6 posts views Thread by Patrick Fisher | last post: by
2 posts views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.