eg:table
pkey --guid
annualpay
datefrom
dateto--if null means current record
percentannualincrease
percent annual increase will be calculated only if there is a difference in newly inserted and previously existing last differing value.
percentannualincrease =
([newannualpay-just previous pay(if different from current)]/newannualpay)*100
eg
newid(),5000,today,null,0--very first row
newid(),5000,today+1,null(*),0
newid,5500,today+2,null(*),?????????????--> need to be calculated before insert
*--insert will close the previous record by updating dateto=null to todays date
How can I do this stuff in a trigger???