Access VBADiscuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Name ID SickCode Date
Jane 2345 607 4/2/2002
Jane 2345 607 7/14/2001
Jane 2345 607 7/30/2001
Jane 2345 7011 4/5/2001
Sam 3876 2330 6/7/2003
Sam 3876 457 5/23/2000
Sam 3876 2330 9/12/2003
This is what I want to obtain when I query using Access:
Jane 2345 607 4/2/2002
Jane 2345 7011 4/5/2001
Sam 3876 2330 6/7/2003
Sam 3876 457 5/23/2000
I just need a sample of the sickcode for each name (doesn't matter the dates)
If anyone can help me to query this using Access, I'll really appreciate your assistance. Thank you very much.
Highlight your table, click Insert > Query. Click Design to open a new query in design view based on your table. Select all of the fields and drag down to the QBE grid. Then click View > Totals. Under your Date field change 'Group By' to 'Max'. This will give you the max date for the unique entries as you described.