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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Most recent Date in a query

Status
Not open for further replies.

Bronnad

Programmer
Jul 2, 2012
16
US
I am running a salary report, and I'm trying to get the most recent date prior to 2/27/2012.

Here is my record Selection

{PRRATEHIST.BEG_DATE} in DateTime (2008, 01, 01, 00, 00, 00) to DateTime (2012, 02, 27, 00, 00, 00) and
{EMPLOYEE.EMP_STATUS} in ["C", "FR", "PR", "SI", "SU"] and
not ({SACIP.EMPLOYEE} in [1.00, 98322.0000000001, 99403.0000000001, 991922.000000002])

The report is Grouped by {PRRATEHIST.EMPLOYEE}, then {PRRATEHIST.BEG_DATE}, then {REVIEW.SCHED_DATE}

I created a Shared NumberVar...
Main
Shared Numbervar MyPreMerit;
MyPreMerit;

SUB
Shared Numbervar MyPreMerit;
if {PRRATEHIST.BEG_DATE} in DateTime (2008, 01, 01, 00, 00, 00) to DateTime (2012, 02, 26, 00, 00, 00)
then
if
({PRRATEHIST.SALARY_CLASS}="H")
then
{PRRATEHIST.PAY_RATE}*{PRRATEHIST.ANNUAL_HOURS}
else{PRRATEHIST.PAY_RATE}

Clear
Shared Numbervar MyPreMerit;
MyPreMerit := ({@Annual});

The formula in {@Annual}
if{PRRATEHIST.SALARY_CLASS}="H"
then{PRRATEHIST.PAY_RATE}*{PRRATEHIST.ANNUAL_HOURS}
else{PRRATEHIST.PAY_RATE}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top