Wrox Programmer Forums
|
Access VBA Discuss 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
 
Old September 9th, 2003, 07:51 AM
Con Con is offline
Registered User
 
Join Date: Sep 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Records management

I have these records:

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.
 
Old September 9th, 2003, 08:22 AM
Authorized User
 
Join Date: Jun 2003
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, pretty simple. Do this.

In the table, set the index of the table to the SickCode field.

Then in your query's properties, set the "Unique Values" field to YES.

This will give you your desired results.

Let me know if you get stuck on it.

John

John
 
Old September 9th, 2003, 08:25 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Regards,

Beth M





Similar Threads
Thread Thread Starter Forum Replies Last Post
roles and management MunishBhatia ASP.NET 2.0 Professional 2 November 3rd, 2007 01:01 AM
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
Content management Mike707 Dreamweaver (all versions) 1 September 1st, 2006 04:43 PM
Transaction Management azmatazz Biztalk 0 April 28th, 2005 07:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.