Need Help With Calculation

Zean

New Member
Oil Form.jpg
Hi i need help to get a value in the green circle here is what i will need it to do.
This is a oil Sample submit form and the fleet number is the number of a machine like a vin number for a car
and the smr km/hr entry is the mileage on the car
so what the calculated field must do is take the last smr km/hr that the "oil changed" was selected in previous submitions and minus that with the new smr hr/km thats entered for that component also marked in red
basically check fleet number and component where "oil changed" = "changed" and minus the old smr hr/km from the new one thats entered and insert it into "smr hr/km oil in use"
it needs to calculate how long the oil is in use from last time it was changed
Hope this males any sense added a picture of elements aswel
i think i should use the calculated field but i have no idea how to calculate this in php
thanks in advance
 

Attachments

  • Oil Elements.jpg
    Oil Elements.jpg
    172.7 KB · Views: 137
nope i cant seam to get the $origData to select the correct records
here is the code piece

$old=$origData->oil_samples___smr_km_hrs_oil;

how do i define that i just need the value for that field where the component is the same as selected in form (drop down) and that oil changed field has the value of changed in the prev records
i kinda start hating php lol
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top