Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACCESS Query HELP!

Status
Not open for further replies.

cdogstu99

MIS
Jan 17, 2005
68
US
ok i have a table with data listed as follows:
date, acct number, and birth date
Some accts have multiple members listed.

DATE ACCT_NUMBER BIRTHDATE
1/3/2005 118896000 12/2/1935
1/3/2005 118896000 1/29/1932
1/7/2005 118899135 6/23/1929
1/10/2005 118899136 6/6/1983
1/18/2005 118899142 4/24/1979
1/21/2005 118899143 12/23/1957
1/21/2005 118899143 12/23/1957

I want to group by date, and have a count of how many members are in each acct and to display the lowest birthdate. Does anyone know how to do this?
 
If I understand your question, you just need to use the Min function:

SELECT tbl.Date, tbl.acct_number, Min(tbl.birthdate) AS MinOfbirthdate, Count(tbl.acct_number) AS CountOfacct_number
FROM tbl
GROUP BY tbl.Date, tbl.acct_number;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top