[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Comparing/Difference of Two Payroll Summaries



Maybe have an outer procedure that says something like this.  Thus you
know what earn codes are going to show up for either.  And then the sub
procedure does all the printing, earn-code by earn-code.

BEGIN-SELECT
DISTINCT EARN_CODE

  DO PRINT-PAYROLL-FOR-THIS-EARN_CODE($earncode)

FROM table where payroll = $x
UNION
SELECT
DISTINCT EARN_CODE
FROM table where payroll = $y
END-SELECT


BEGIN-PROCEDURE PRINT-PAYROLL-FOR-THIS-EARN-CODE($earncode)
  let $exists = 'N'
BEGIN-SELECT
print_data
  let $exists = 'Y'

FROM table where payroll = $x
AND  earn_code = $earncode
END-SELECT

  IF $exists = 'N'
    PRINT 'DOES NOT EXIST IN ' $x ' CANNOT COMPARE DIFFERENCE'
  ELSE
    PRINT print-data (normal printed row).
  END-IF

  ...do same for payroll $y.

END-PROCEDURE




-----Original Message-----
From: sqr-users-bounces+bstone=fastenal.com@sqrug.org
[mailto:sqr-users-bounces+bstone=fastenal.com@sqrug.org] On Behalf Of
Jean Myles
Sent: Tuesday, August 28, 2007 8:43 AM
To: sqr-users@sqrug.org
Subject: [sqr-users] Comparing/Difference of Two Payroll Summaries

I have been asked to create a report that compares two consecutive
payroll
summaries for a specific pay year, pay id, and payroll run  (all
prompts)  

The final report would appear like the following:

 

Payroll1
Payroll2                                                

Pay ID      Earn Code       Total
Pay
ID      Earn Code       Total                          Difference

 

RG            ABC               1000.00
RG
ABC                400.00                        600.00

RG            DEF                2000.00
RG
DEF                1500.00                      500.00

 

 

 

The issue is, both payrolls could have earn codes that do not exist in
the
other payroll.  (Eg: Payroll 1 - GHI , 500.00 but does not exist in
Payroll
2)  

 

RG           GHI                     500.00
DOES NOT EXIST IN THIS PAYROLL - CANNOT GET TO PRINT/DIFFERENCE

 

I have stored the first payroll in a temp table and can select the
common
earn codes to the second payroll.  How do I get the earn codes that are
unique to each payroll to be listed as well?  And is there a way to
insert a
zero if it does not exists so that it can be subtracted for a difference
value?

 

I thank you in advance for your assistance.

 

 

Jean Myles

 <mailto:jean_myles@fitnyc.edu> jean_myles@fitnyc.edu

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users