Pull previous Value in action

 2 Replies
 1 Subscribed to this topic
 68 Subscribed to this forum
Sort:
Author
Messages
Sylvie
Basic Member
Posts: 15
Basic Member
    I need to create a query that will pull the new and previous values in an action.  I can pull new value and I know the previous value is stored in HRHISTORY table.. I have not been able to pull the previous value only out of the table..  I am running the PA340 report to try and get the information but witht the system issues we are having it is taking a long time each time it needs run.  Has anyone pulled this information in an access query and if so are you willing to share your query setup?  Thanks
    pbelsky
    Veteran Member
    Posts: 80
    Veteran Member

      Hi Sylvie! It sounds like this is for actions that have completely processed, and you are getting the "new" values from EMPLOYEE, PAEMPLOYEE, etc (e.g. the new values are now the current values)? And you want to know how to pull the previous values from HRHISTORY? If that is correct, here is what I would do: Find the HRHISTORY record(s) with the same BEG_DATE as the EFFECT_DATE (PERSACTHST) of the action to get the "new" values. Then get the HRHISTORY record with the next most recent date for that same FLD_ NBR for the "old" values.

      If you need to know what the HRHISTORY FLD_NBRs stand for: Go to PERSACTYPE and look up the action code of your personnel action. For each action code, there are columns FLD_NBR_01 thru FLD_NBR_36. These numbers correspond to the FLD_NBR in PADICT under topic E1. In PADICT, the ITEM_NAME column and the DB_FILE column associated with the FLD_NBR describe what value is being updated and where it is.

      John Henley
      Posts: 3353
        See if anything in this post helps you find what you're looking for:
        https://www.lawsonguru.co...work-history-report/

        Not sure what your ultimate goal is (you mentioned Access), whether you're looking for a comprehensive report, or a query you want to use for occasional research, etc.
        Depending on your technical comfort level, there are several techniques that can be used to retrieve previous values (i.e. addins against HRHISTORY, SQL with sub queries, SQL with LAG() function, Crystal with sub reports, etc.)
        Essentially
        Thanks for using the LawsonGuru.com forums!
        John