A
Ashers
I am helping my brother with his mileage claims database, for under 10K miles
you get one rate and another for over 10K. There was a simple update that
worked with one exception and that was the job that crossed over from one
rate to another.
I have written the code below, but Access doesn't like it and after a couple
of hours looking I can't see why. Any help will be greatly appreciated.
UPDATE [Cost Update 1] SET [Cost Update 1].Cost
=IIf(DSum(("[Miles]","Mileage")-[Miles])>=10000,([Miles]*0.25),IIf(DSum("[Miles]","Mileage")<10000,([Miles]*0.4)),(DSum("[Miles]","Mileage"
- 10000)*0.25)+(([Miles]-(DSum("[Miles]","Mileage") - 10000))*0.4));
you get one rate and another for over 10K. There was a simple update that
worked with one exception and that was the job that crossed over from one
rate to another.
I have written the code below, but Access doesn't like it and after a couple
of hours looking I can't see why. Any help will be greatly appreciated.
UPDATE [Cost Update 1] SET [Cost Update 1].Cost
=IIf(DSum(("[Miles]","Mileage")-[Miles])>=10000,([Miles]*0.25),IIf(DSum("[Miles]","Mileage")<10000,([Miles]*0.4)),(DSum("[Miles]","Mileage"
- 10000)*0.25)+(([Miles]-(DSum("[Miles]","Mileage") - 10000))*0.4));