Group by and Min function

G

Guest

How do I:
1) Group a list of transactions by Item#. There are multiple Item# with
several transactions. Group_by???
2) Select the earliest date for each transaction in the group?

My output will give me every item with the earliest date date each item was
purchased.
thx
 
D

Duane Hookom

SELECT ItemNum, Min(PurchaseDate) as MinPurchDate
FROM tblTransactions
GROUP BY ItemNum;
 
D

Duane Hookom

My suggestion would be the SQL view of a query. This is the "queries" news
group. If you would like to see a value in a text box, you need to provide
more information.
 

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

Similar Threads


Top