Previous Pay Rate Query from PRRATEHIST

 2 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
vc727
Advanced Member
Posts: 44
Advanced Member
    I am trying to write a query that will tell me the employees pay rate just previous to the current rate. Using the query Builder is this possible?  What I have now just Gives me a list of all previous rates. I need to limit it to just the most recent rate.

    Any help would be appreciated.
    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      This is a simple solution:
      If the previous pay record you're looking for is the last record of your Query then let it loop through all the records and then get the last record's value. If the previous pay record is the first record of your Query then limit it to 1 record and pick up that value.
      David Williams
      Gary Davies
      Veteran Member
      Posts: 248
      Veteran Member
        The table has an index that has the Begin Date in reverse order (PRHSET2), so there is no need to spin through all records for a specific employee just read the first one.   It is by POS-LEVEL though.