844-NOGALIS (844-664-2547)
Nogalis, Inc.
  • Link to Facebook
  • Link to X
  • Link to LinkedIn
  • Link to Mail
  • Company
    • News, Events and Articles
    • About Us
  • Products
    • Infor Lawson Data Archive
    • PeopleSoft Data Archive
    • Oracle Data Archive
  • Services
    • Infor Lawson Support
    • Infor Lawson / CloudSuite Consulting
  • Education & Training
  • Support
  • Contact Us
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu
Lawson SQL Code Snippets

Two SQL queries that we found helpful in the Lawson Absence Management Suite

News, Uncategorized
Lawson SQL Code Snippets

Lawson SQL Code Snippets

We don’t typically post technical information here on the blog, that’s mostly reserved for the education section of the site. The past couple of week however we were able to write a couple of queries that helped out a customer quite a bit so we figured maybe you all can benefit from them. Without any further delay, here they are:

 

 


-- Get available balances for employees in a specific group and/or plan
select E.COMPANY,E.EMPLOYEE,E.FIRST_NAME,E.LAST_NAME ,E.EMP_STATUS, T.R_PLAN, T.EMPLOYEE_GROUP,T.ACCR_LAST_DT,T.AVAIL_HRS_BAL
From [PROD].[dbo].TAEEMASTER T, [PROD].[dbo].EMPLOYEE E
Where 
-- T.EMPLOYEE_GROUP = 'EXAMPLE' and
T.R_PLAN='XXX' and
T.COMPANY = E.COMPANY and
T.EMPLOYEE = E.EMPLOYEE and
E.EMP_STATUS not like 'T%';
-- Obviously you'll have to change the Employee Group, the Plan code, and the Emp-Status condition to match yours.

This next statement does something rather unique. It reaches into GEN to get the status code definitions for the table field. Nifty!

-- Get all transactions for specific employee group and plan since a specific date including field transactions from GEN
select E.COMPANY,E.EMPLOYEE,E.FIRST_NAME,E.LAST_NAME ,E.EMP_STATUS, T.R_PLAN, T.EMPLOYEE_GROUP,T.TA_HOURS,T.DESCRIPTION,A.VALXLT as 'TYPE',B.VALXLT AS 'TRAN TYPE',C.VALXLT AS 'STATUS',D.VALXLT AS 'BALANCE TYPE'
From [PROD].[dbo].TAEMPTRANS T, [prod].[dbo].EMPLOYEE E , [GEN].[dbo].[VALLST] A, [GEN].[dbo].[VALLST] B, [GEN].[dbo].[VALLST] C, [GEN].[dbo].[VALLST] D
Where 
T.EMPLOYEE_GROUP = 'EXAMPLE' and
T.R_PLAN in('XXX','YYY') and
T.COMPANY = E.COMPANY and
T.EMPLOYEE = E.EMPLOYEE and
T.R_DATE >= '2015-01-01' and
A.DOMVAL =  T.TA_TYPE and
B.DOMVAL =  T.TRAN_TYPE and
C.DOMVAL =  T.STATUS and 
D.DOMVAL = T.BALANCE_TYPE and
A.PRODUCTLINE = 'PROD' and A.FILENAME='TAEMPTRANS' and A.FLDNAME='TA-TYPE' and
B.PRODUCTLINE = 'PROD' and B.FILENAME='TAEMPTRANS' and B.FLDNAME='TRAN-TYPE' and
C.PRODUCTLINE = 'PROD' and C.FILENAME='TAEMPTRANS' and C.FLDNAME='STATUS' and
D.PRODUCTLINE = 'PROD' and D.FILENAME='TAEMPTRANS' and D.FLDNAME='BALANCE-TYPE';

-- You'll have to change the Employee Group, the Plan codes, and the date condition to match yours.

Retiring Lawson, PeopleSoft, or Oracle? APIX archives the entire application — every table, every year, attachments and security included — into your own AWS account in about 30 days, so you can decommission the legacy system and keep full access to the history.

See how the APIX ERP archive works →

09/22/2015
Share this entry
  • Share on Facebook
  • Share on X
  • Share on WhatsApp
  • Share on LinkedIn
  • Share on Reddit
  • Share by Mail
https://www.nogalis.com/wp-content/uploads/2015/09/sql.png 512 512 nogalis https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png nogalis2015-09-22 16:20:192015-09-22 16:44:37Two SQL queries that we found helpful in the Lawson Absence Management Suite

LEGACY ERP DATA ARCHIVE SOLUTION



Discover how our clients are leveraging AWS services to archive their Legacy ERP data and provide ubiquitous access to users via a light-weight, secure, and read-only web interface. Secure, Fast, Reliable, and Cost Effective. That is the promise of APIX. Follow the link below to find out more and book a discovery call with our data archive specialist.

BOOK DEMO

© Copyright - Nogalis, Inc. 2026
  • Legal
  • Privacy
  • Contact Us
Link to: 3 Steps For Unlocking Hidden Value In Your CRM Data Link to: 3 Steps For Unlocking Hidden Value In Your CRM Data 3 Steps For Unlocking Hidden Value In Your CRM Data Link to: How to add a welcome message or notification to the portal login page Link to: How to add a welcome message or notification to the portal login page Custom Lawson Portal MessageHow to add a welcome message or notification to the portal login page
Scroll to top Scroll to top Scroll to top