PC Review


Reply
Thread Tools Rate Thread

Combining records by date

 
 
nadesico
Guest
Posts: n/a
 
      26th Mar 2010
Hi,
I am a novice at programming so please bear with me. What I am trying to do
is combine records from a query and place them in a table. Basically, what I
want to do looks like this.

Starting Data
client id auth no start date end date units
1 2 9/16/2009 9/28/2009 13
1 3 9/29/2009 9/30/2009 2
1 4 10/1/2009 10/4/2009 5
1 5 11/17/2009 11/22/2009 6
1 6 11/23/2009 11/30/2009 3
1 7 12/1/2009 12/7/2009 8
2 8 11/20/2009 11/30/2009 11
2 9 12/1/2009 12/4/2009 4
2 10 12/29/2009 12/31/2009 3
2 11 1/1/2010 1/11/2010 11

End Data
client id auth no start date end date units
1 2, 3, 4 9/16/2009 10/4/2009 20
1 5, 6, 7 11/17/2009 12/7/2009 17
2 8, 9 11/20/2009 12/4/2009 15
2 10, 11 12/29/2009 1/11/2010 11

I don't think I can do this with a query so I posted it here. Any help
would be greatly appreciated. I am currently using access 2000

Thanks
 
Reply With Quote
 
 
 
 
Tom van Stiphout
Guest
Posts: n/a
 
      26th Mar 2010
On Thu, 25 Mar 2010 17:42:01 -0700, nadesico
<(E-Mail Removed)> wrote:

I would do this with a recordset. However it really requires more
programming skills than can be expected of a novice.
In pseudo-code:
Open a DAO.Recordset object on the table, sorted correctly.
Loop over the records, looking for gaps in the dates. All the way
accumulating the first begin_date, last end_date, and consequtive
auth_no's.
If a gap is detected, write a record to the EndData table.

-Tom.
Microsoft Access MVP


>Hi,
>I am a novice at programming so please bear with me. What I am trying to do
>is combine records from a query and place them in a table. Basically, what I
>want to do looks like this.
>
>Starting Data
>client id auth no start date end date units
>1 2 9/16/2009 9/28/2009 13
>1 3 9/29/2009 9/30/2009 2
>1 4 10/1/2009 10/4/2009 5
>1 5 11/17/2009 11/22/2009 6
>1 6 11/23/2009 11/30/2009 3
>1 7 12/1/2009 12/7/2009 8
>2 8 11/20/2009 11/30/2009 11
>2 9 12/1/2009 12/4/2009 4
>2 10 12/29/2009 12/31/2009 3
>2 11 1/1/2010 1/11/2010 11
>
>End Data
>client id auth no start date end date units
>1 2, 3, 4 9/16/2009 10/4/2009 20
>1 5, 6, 7 11/17/2009 12/7/2009 17
>2 8, 9 11/20/2009 12/4/2009 15
>2 10, 11 12/29/2009 1/11/2010 11
>
>I don't think I can do this with a query so I posted it here. Any help
>would be greatly appreciated. I am currently using access 2000
>
>Thanks

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combining Records Agent_KGB Microsoft Access Queries 3 22nd Oct 2009 03:48 PM
combining records =?Utf-8?B?a2xubWlz?= Microsoft Access Queries 1 26th Jun 2006 09:28 PM
Combining records =?Utf-8?B?U3RldmUgWQ==?= Microsoft Access 4 17th Apr 2006 09:55 PM
Combining records Rebecca Microsoft Access Queries 4 29th Jul 2004 04:15 PM
Query combining multiple records from one table can't add records Clint Marshall Microsoft Access Queries 4 8th Jul 2004 01:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:39 PM.