Results 1 to 3 of 3
  1. #1
    lydonw is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    1

    Comparing pairs of records in a query

    I'm really hoping someone can help me with this. I've tried to get help in another forum and received absolutely ZERO response.

    I need to identify pairs of records by their ID and date fields, then compare their number values.

    I have a query with the following fields: AuthInstanceID, ConsumerID, AuthNumberID, AuthStart, AuthEnd, PSRUnits, BSTUnits.

    This query has many records for many different ConsumerIDs, and there is no limit to the number of records using a particular ConsumerID. Need to compare records in the following fashion:

    1) Identify pairs of records where ConsumerID is the same AND AuthStart dates are successive.
    2) Compare PSRUnits of these paired records to see what the numerical change has been between dates
    3) Add the value of this change to a field called PSRChange
    4) Repeat 2-3 for BSTUnits

    I can give sample data, screenshot, or anonymized database, as needed. Any help is VERY appreciated

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Till some one comes along,
    can you elaborate on "ConsumerID is the same AND AuthStart dates are successive".
    If possible, request you to post some dummy data & the result you expect, after running the query.

    Thanks

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    sample data, screenshot,
    Would be very helpful. Also expected results.

    Are there always only (exactly) two records per ConsumerID?

    I can see this taking a lot of code....

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

Similar Threads

  1. Replies: 3
    Last Post: 08-08-2012, 03:15 AM
  2. Comparing records in 2 tables
    By jlgray0127 in forum Forms
    Replies: 1
    Last Post: 03-16-2012, 01:53 PM
  3. Comparing Records in two (2) Tables.
    By RalphJ in forum Programming
    Replies: 19
    Last Post: 04-19-2011, 02:50 AM
  4. Comparing Like Records
    By JSAKelley in forum Queries
    Replies: 0
    Last Post: 04-16-2011, 05:31 PM
  5. Replies: 4
    Last Post: 09-24-2010, 11:23 PM

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