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

Need most recent check record per employee id- diff tables

Status
Not open for further replies.

franceshd

Programmer
Aug 8, 2004
30
US
I want to use the most recent paycheck per employee.
But the table with the date does not contain the EmployeeNumber.
PRCKHEAD = Check Header Table (main key = PR_RUN_ID)
PRCKHEMP = Employee Check History Table (main key = EMPL_NO)

The (non-SQL) GroupSelection is:

{PRCKHEAD.CHECK_DATE} =
Maximum ( {PRCKHEAD.CHECK_DATE} ) AND

{PRCKHEMP.PR_RUN_ID} = {PRCKHEAD.PR_RUN_ID} AND

{PRCKHEMP.EMPL_NO} = Maximum ( {PRCKHEMP.EMPL_NO} )

It only produced ONE person out of 9000 employees AND
it was not the latest check.

PLEASE HELP! I have run out of ideas.

THANKS SSOOO MMMUUUUCCCCCHHHHHHHH!!!!!
 
Please don't create multiple posts on the same topic. I already responded to your question tagged onto someone else's thread. It would have been better to start a new thread in the first place--for future reference.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top