|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
updating cumulative savings depending on end date !Really help!
Basicaly I have a table which holds the list of projects the company has done. And I store 'projectenddate' 'Savings' and 'cumulative savings' all txt fields. The 'Cumulative savings' is to be calculated on the same day every year that that the project ended. This cumulative field should add the amount in the Savings field once a year. The problem is that all projects end on different dates through out the year. so I need to know how i could scan the table field 'projectenddate' on a daily basis and if the day and month is the same as project end date, then update the cumulative field once only every year (what if the database is opened twice in same day , don't update twice!!!)
For example: Year 1 projectenddate=01/01/2004 Savings=£20,000 Cumulative savings=£20,000 Year 2 (it is now 1 year to the day) Savings=£20,000 Cumulative Savings=£40,000 etc (keep adding the amount of savings to the cumulative every year) Has anyone any ideas on the code that could keep the 'cumulative savings' text field uptodate and where do i put it Cheers castor |
|
#2
|
||||
|
||||
|
Generally, I would log the calculations in a table and check at startup if the calculation is done for a certain year (current year, for example). If no, then I would call a sub that opens the table via DAO and runs a cycle within it that looks through the table and vould calculate the cummulative values.
__________________
BRegs, TBÁrpi "I can only show you the door. You're the one who has to walk through it." |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > updating cumulative savings depending on end date !Really help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|