Results 1 to 6 of 6
  1. #1
    raghuprabhu is offline Novice
    Windows Vista Access 2003
    Join Date
    Apr 2012
    Posts
    8

    Compare and show differences ...

    Hi I have a table called tblOffset. It has the following data

    ID Surname Code1 Code2 Code3 Code4 Amount payPeriod


    1 Prabhu -aaa -bbb -ccc -ddd -$1,234.00 -2012/21
    2 Jain -ccc -ddd -eee -fff- $1,233.00 -2012/21
    3 Kumar- ddd -eee -fff -ggg- $1,245.00 -2012/21
    4 Singh -aaa- ddd -eee- ddd -$1,236.00- 2012/12
    5 Reddy -aaa -ddd- fff -fff -$1,122.00- 2012/12

    6 Prabhu ggg ddd ddd ccc $2,222.00 2012/22
    7 Jain ccc ddd eee fff $1,233.00 2012/22
    8 Kumar ddd eee fff ggg $1,245.00 2012/22
    9 Singh aaa ddd eee ddd $1,236.00 2012/22
    10 Reddy aaa ddd fff fff $1,122.00 2012/22
    11 Arora ddd ddd ddd ddd $2,212.00 2012/22

    12 Prabhu ggg ddd ddd ccc $2,222.00 2012/23
    13 Kumar ddd eee fff ggg $1,245.00 2012/23
    14 Singh aaa ddd eee ddd $1,236.00 2012/23
    15 Reddy aaa ddd fff fff $1,122.00 2012/23
    16 Arora ddd ddd ddd ddd $2,212.00 2012/23

    I want to design 3 queries. All the queries have to compare records two consecutive pay periods at a time.

    The first 5 records are in pay period 2012/21, 6 in pay period 2012/22 and 5 in pay period 2012/23.

    First query: Here record 1 and 6 are for the same person but the fields Code1, Code2, code3, code 4 and amount have changed in pay period 2012/22. How do I compare records in pay period 2012/21 and 2012/22 and show these two records as the query out put?

    Second query: Record 11 is a new record input in pay period 2012/22. It was not there in pay period 2012/21. How do I compare records in pay period 2012/21 and 2012/22 and show this record as the query out put?

    Third query: Record 7 was input in pay period 2012/22 but it was omitted in pay period 2012/23. How do I compare records in pay period 2012/22 and 2012/23 and show this record as the query out put?

    Thanks in advance
    Raghu Prabhu

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    What did you try? What results did you get? Please show us your work.

  3. #3
    raghuprabhu is offline Novice
    Windows Vista Access 2003
    Join Date
    Apr 2012
    Posts
    8
    Quote Originally Posted by orange View Post
    What did you try? What results did you get? Please show us your work.
    Will try out your suggestion and post it tomorrow.

    Raghu

  4. #4
    raghuprabhu is offline Novice
    Windows Vista Access 2003
    Join Date
    Apr 2012
    Posts
    8
    test3Query.zipHi Orange,

    Attached a sample database. Was able to do the second and third queries but not the first one.
    Cheers

    Raghu

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849

  6. #6
    raghuprabhu is offline Novice
    Windows Vista Access 2003
    Join Date
    Apr 2012
    Posts
    8
    test3Query Solved.zipThanks will do.

    Cheers

    20 May 2012

    Here it is solved
    Last edited by raghuprabhu; 05-19-2012 at 10:01 PM. Reason: solved

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

Similar Threads

  1. Compare two tables and show it in a form
    By Jim.H. in forum Access
    Replies: 1
    Last Post: 01-25-2012, 08:51 PM
  2. Replies: 1
    Last Post: 09-07-2011, 02:42 AM
  3. Crosstab Query - Column differences conflict
    By JoshZulaica in forum Queries
    Replies: 1
    Last Post: 06-23-2011, 01:43 AM
  4. Compare tables and tell me differences
    By cowboy in forum Programming
    Replies: 2
    Last Post: 08-11-2010, 08:32 AM
  5. INNER JOIN differences from SQL Server
    By naurispunk in forum Queries
    Replies: 0
    Last Post: 07-22-2010, 03:17 AM

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