Hi All,
I need some help with writing a SQL statement that will retrieve the current record and the previous record from the history table.
I am trying to determine when we have employees that change WCB and/or Province of Work in the current year
Here is my current query
select jwan8, jwefto, jwhstd as CurrValue, lag(jwhstd,1,0) over (order by jwefto desc) as prevValue
from proddta.f08042
where jwfile = 'F060116'
and jwan8 =901670
and jwdtai = 'TARA'
and jwtrs != '001'
This gives me the following result
AN8 EFTO HSTD Prev Value
901670 118060 700010000 0
901670 117255 700210000 700010000
901670 103001 700010000 700210000
What I would ultimately like to see is
AN8 EFTO HSTD Prev Value
901670 118060 700010000 700210000
I want to see the most current value along with the previous value
We are working on converting our JDE data (9.1) to a cloud based HCM system.
Any help would be appreciated
Thanks
Pam
I need some help with writing a SQL statement that will retrieve the current record and the previous record from the history table.
I am trying to determine when we have employees that change WCB and/or Province of Work in the current year
Here is my current query
select jwan8, jwefto, jwhstd as CurrValue, lag(jwhstd,1,0) over (order by jwefto desc) as prevValue
from proddta.f08042
where jwfile = 'F060116'
and jwan8 =901670
and jwdtai = 'TARA'
and jwtrs != '001'
This gives me the following result
AN8 EFTO HSTD Prev Value
901670 118060 700010000 0
901670 117255 700210000 700010000
901670 103001 700010000 700210000
What I would ultimately like to see is
AN8 EFTO HSTD Prev Value
901670 118060 700010000 700210000
I want to see the most current value along with the previous value
We are working on converting our JDE data (9.1) to a cloud based HCM system.
Any help would be appreciated
Thanks
Pam