Results 1 to 2 of 2
  1. #1
    pokan is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Feb 2017
    Location
    Sacramento, CA
    Posts
    1

    Question Combine records where there are consecutive months into one record, Access 2010

    Hi, I have an employee segment table, there are situations where an employee will have multiple record segments. I like to combine the multiple records into one record if the date in the segments are consecutive months, either into a new table or in a query. Please see example.


    For example: (Fields: employee_name | segment_start_date | segment_end_date)
    J Smith | 11/1/15 | 12/31/15
    J Smith | 1/1/16 | 4/30/16


    J Smith | 5/1/16 | 6/30/16
    J Smith | 11/1/16 | 12/31/16


    The end result should be two records:
    J Smith | 11/1/15 | 6/30/16 (because from 11/1/16 to 6/30/16, there was no break in J Smith's employment.)
    J Smith | 11/1/16 | 12/31/16 (because after 6/30/16, there was a break, and then from 11/1/16 to 12/31/16, there was no break.)


    I would appreciate any advice you guys can give. Thanks!

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The only way I would know of to do this is using (a lot of) VBA and writing to a new table.

    Not hard, but it will take a fair amount of time to write the code and debug the code and verify the results.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-16-2015, 04:54 AM
  2. Replies: 7
    Last Post: 06-09-2014, 11:55 AM
  3. Replies: 3
    Last Post: 02-23-2014, 02:06 PM
  4. Combine several records into one record
    By Helge in forum Queries
    Replies: 9
    Last Post: 01-25-2014, 03:26 PM
  5. Replies: 8
    Last Post: 01-21-2011, 10:28 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums