Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Performance Management
Lawson Business Intelligence/Reporting/Crystal
HRHISTORY table compare date rows
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Chris Radcliffe
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5187
People Online:
Visitors:
184
Members:
0
Total:
184
Online Now:
New Topics
S3 Customization/Development
Cobol - Extract Current Time
4/24/2024 7:21 PM
How do you extract just the Current System Time in
Lawson Landmark
LPL INSTR Functions
4/5/2024 8:32 PM
I'm writing a simple report using the Create R
Infor SCM
Translating 856 to get the ~ REF^CN^ field
4/3/2024 8:24 PM
We are trying to get the tracking number which is
IPA/ProcessFlow
Sample XML file create Flow
4/3/2024 3:43 PM
Hello everyone, I am new to creating XML files
Lawson S3 HR/Payroll/Benefits
bn105 error message
3/26/2024 6:40 PM
I need to change some of the set ups in our Life I
IPA/ProcessFlow
IPA executing Job
3/13/2024 7:08 PM
New to the IPA world and was wondering, can an IPA
Lawson S3 HR/Payroll/Benefits
Life Age Reduction on benefits plans
3/12/2024 7:15 PM
For our optional life we have an age based coverag
Lawson S3 HR/Payroll/Benefits
BN53.1 Add-In
3/7/2024 3:31 PM
We are migrating to Solstice. They require a
Lawson Business Intelligence/Reporting/Crystal
Domain Name Change
3/5/2024 7:45 PM
Our domain name needs to change and was hoping I c
S3 Customization/Development
Cobol calling Shell Script
2/29/2024 1:27 PM
Has anyone created or modified a Lawson Cobol prog
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3288
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1351
Roger French
1311
mark.cook
1244
Forums
Unanswered
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Lawson Business Intelligence/Reporting/Crystal
HRHISTORY table compare date rows
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
Sarah
Advanced Member
Posts: 33
3/19/2012 4:49 PM
How do I use the HRHISTORY table to look at the most recent (fld nbr 51)ADJ_HIRE_DT - (fld nbr 27)LAST TERM DT and if it's less than 365 days take the (fld nbr 26)PREVIOUS SENIORITY DT and add those days to the PREV SENIORITY DT to identify what the employees TRUE SENIORITY DT should be.
Example: Employee is rehired with an adj_hire_dt = 02/19/2012. Their previous term date = 02/22/2011 so
02/19/2012-02/22/2011=362 days
Their previous seniority date = 03/09/2001+362=03/06/2002.
I've been able to export this information into excel and manipulate it that way so I can audit who needs to have their seniority date fixed but I'd like to create a report that anyone can run on the Lawson Dashboard.
Any ideas?
TIA,
Sarah
S Eckerson
Basic Member
Posts: 7
3/19/2012 5:50 PM
Hi Sarah,
If you are on Oracle (It appears that SQL Server 2012 has these functions), you can use the LAG/LEAD function to find previous or next values from HRHISTORY. It is a bit tedious to get all of the data you might want from HRHISTORY, but it's fun to tease out just the stuff you're looking for.
Here are some example of SQL code using the LAG/LEAD functions. This is looking at field 20 (employee status) but change the fld_nbr and it will work for any type change.
select
hrhistory.company
,hrhistory.employee
,hrhistory.seq_nbr
,hrhistory.beg_date
,hrhistory.a_value
,hrhistory.act_obj_id
--next line will get the max act_obj_id for those employees who have more than one change on one day
,max(act_obj_id)over(partition by hrhistory.employee,hrhistory.beg_date) max_record
--next line gives you a total count of changes by employee
,count (*) over( partition by hrhistory.employee order by hrhistory.employee) total
--next line returns previous value
,lag(hrhistory.a_value,1) over( partition by hrhistory.employee order by hrhistory.act_obj_id, seq_nbr)previousvalue
--next line returns beg_date of previous value
,lag(hrhistory.beg_date,1)over( partition by hrhistory.employee order by hrhistory.act_obj_id, seq_nbr)prevaldate
from lawprod.hrhistory
where
hrhistory.fld_nbr = 20
and hrhistory.date_stamp >= '01-JAN-12'
and hrhistory.date_stamp <= '01-FEB-12'
Enjoy!
Sarah
Advanced Member
Posts: 33
3/19/2012 6:20 PM
Interesting. Let me play around with this SQL and see if I can get it to work.
Thank you!
You are not authorized to post a reply.