min and max dates

G

Guest

having trouble with using min and max functions to return dates. need to select the min and max date for each item# from a table. multiple date entries for each item#. i already created a query to rank dates so do have ranking on each date for each item. maybe i should use rank in next query instead!?! thx.
 
F

fredg

having trouble with using min and max functions to return dates.
need to select the min and max date for each item# from a table.
multiple date entries for each item#. i already created a query to
rank dates so do have ranking on each date for each item. maybe i
should use rank in next query instead!?! thx.

Does this help?

SELECT DISTINCT YourTable.ItemNum, Max(YourTable.ADate) AS MaxDate,
Min(YourTable.ADate) AS MinDate
FROM YourTable
GROUP BY YourTable.ItemNum;
 

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