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

Re: data comparsion



Why dont try getting the max(eff_date) of the same employee but is should not 
be equal to the recent max(eff_date) of that employee. You may need to use two 
separate query for this logic.

12345   01-Apr-2002  50,000  max(eff_date) &recent_effdate
12345   01-Apr-2001  40,000  max(eff_date) != &recent_effdate

Best Regards,
Emil

-----Original Message-----
From: Lorraine Ambrosio [mailto:lorraine.ambrosio@TECKCOMINCO.COM]
Sent: Saturday, April 20, 2002 9:23 AM
To: SQR-USERS@list.iex.net
Subject: data comparsion


I want to compare for the same person, the most recent date/salary with the
last prior record. How do I get the 2nd record?


eg. fields
empnbr  eff_date    annual_salary

12345   01-Apr-2002  50,000  max(eff_date)
12345   01-Apr-2001  40,000  ???

then take 50,000 / 40,000 * .02 / 9/14 = net adj.