Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to calculate Period Begin Date in a Derived Field or other 1

Status
Not open for further replies.

Helixe

Technical User
Oct 16, 2006
8
US
Hello,

I am using ADP PCPW V 5.1, and ReportSmith V 4.2.2002/Oracle.

Acording to ADP, "period begin" date is calculated and not stored, therefore, this date is not available in tables. I'm thinking that a derived field can calculate period begin from either paydate-12 or period end - 13. There is a catch. We use "pay group" to identify the period end for hourly versus salary employees. This field is just a radio buttion, which I believe triggers a calc during transmission of the payroll. In text terms, this is what I'm trying to accomplish:
(Our hourly employees are paid one week in arrears, while salary employees are paid current. For example, salary employee's period begin date is 03/16/08 and ends on 03/29/08 Hourly's begin date is 03/10/08 and ends on 03/23/08. The pay date 03/28/08 is the same for both groups.)

RateType = H, paydate minus 18
RateType = S, paydate minus 12

Any assistance would appreciated.
 
This should do it:

DECODE("JOB"."RATE_TYPE",
/* IF RateType = H, paydate minus 18 */
'H',("AL_CHK_DATA"."PAY_END_DT" - 18),
/* ELSE RateType = S, paydate minus 12 */
("AL_CHK_DATA"."PAY_END_DT" - 12))

Specializing in ReportSmith Training and Consulting
 
Hi Charles,

I believe your suggestion applies to a different version of ReportSmith as our tables start with "V_". But actually, I don't think it matters since your suggestion is spot on and I actually continued working on the calc after I posted this question. Here's what I came up with and hope you would be so kind to confirm:

DECODE("REPORTS"."V_EMPLOYEE"."RATETYPE",'H' ,"REPORTS"."V_CHK_VW_HOURS"."CHECKVIEWPAYDATE"-18,'S',"REPORTS"."V_CHK_VW_HOURS"."CHECKVIEWPAYDATE"-12 )

Thank you for your support.
 
Yes this looks good. It is easier if you format it.

DECODE("REPORTS"."V_EMPLOYEE"."RATETYPE",
'H' ,"REPORTS"."V_CHK_VW_HOURS"."CHECKVIEWPAYDATE" - 18,
'S',"REPORTS"."V_CHK_VW_HOURS"."CHECKVIEWPAYDATE" - 12)

The only issue you will have is it will return NULL if it is not H or S for some reason. If you look at mine I only check for H and ALL others get treated as an S.

Good Job !!!!

Specializing in ReportSmith Training and Consulting
 
Hi Charles,

Thank you for the quick response. I'm still learning about properly using selection criteria, derived fields and grouping. In fact, I'm giving some time to replicate checkview data, but it may be a moot issue since I'm planning on upgrading ADP, which means Crytal Reporting. Therefore, you've been extremely helpful to users of this forum including myself.

Best regards,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top