Link to home
Start Free TrialLog in
Avatar of valentinemhlanga
valentinemhlangaFlag for United States of America

asked on

Handling increments and decrements in SQL

hello All,

I have time records stored in this Master Table and will be importing time records to the timesheet app every 5 minutes from the Master table. I will need to get only 5 the differences and only new data from the master data table. I have  unique fields and two fields that will change everytime which is the minutes worked and the Paycode.

For example if an employee enters 300 minutes and later changes to 200 minutes I want the code send -100 or when an employee enters 100 minutes and later changes it to 400 want it to send +300 minutes to the app.

I am still brainstoming, even though you might not provide the actual code but I just need the pseudocode. I have no where to start thats why I did not provide any sample code.

Please assist and dont mistake me not having anywhere to start as laziness.

thank you.
Avatar of Qlemo
Qlemo
Flag of Germany image

You need a complete copy of the prior absolute data for getting differences.  Match both, subtract the values, and remove anything with 0 values only. Then replace the copy with the actual data for the next go.
ASKER CERTIFIED SOLUTION
Avatar of Vitor Montalvão
Vitor Montalvão
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial