I have a vacation request app I'm designing, and it has a VacationData Table with TotalVac, UsedVac, VacLeft, VacationCarriedOver, and VacCompleted.
I need to take the VacLeft and divide by 2 and place that data in the following two spots, one in the VCO and add it to the TotalVac, which is pulled from another table w/hire date and other info.
I only need to run this on Jan 1 of every year, any suggestions?
Write a console application and run it as a scheduled task.|||You can schedule a job to run on SQL Server using the SQL Agent on Jan 1. You can also schedule it through the command-line "AT" command. A third option is to detect the year change in your application like in session start. A fourth option is to detect it in the stored procedures you are using to retrieve that data.
Take your pick.
IMHO however, I suspect it would probably be best to track when vacation days are earned, and when they are spent. Having this data already, those two fields are now redundant, but could be emulated as computed fields using a user defined function.
No comments:
Post a Comment