Error calculating with dates
-
Hello, in my mortgage calculator we have the possibility to enter two dates of birth to work with dates.
Date 1 = fieldname7
Date 2 = fieldname8And to calculate the contract age a third section with the current date (fieldname12) is used.
The calculator works fine when both dates of birth are entered, but when the second one is removed (as it is not mandatory). The desired result is not obtained.
Specifically the error is in the field “Edad de Contratacion”, when removing the second age field (fieldname8). The result should be 80, as it should only take the fieldname7 data. But it shows 52. And it messes the other calculations.
This is the calculation used for this field “Edad de contratacion” or fieldname11:
+ROUND(((YEAR(fieldname12)-YEAR(MAX(fieldname7,fieldname8)))*360+(MONTH(fieldname12)-MONTH(MAX(fieldname7,fieldname8)))*30+(DAY(fieldname12)-DAY(MAX(fieldname7,fieldname8))-1))/360,0)
How can I do so that if the date of birth is not filled in fieldname8, the calculation can operate normally?
ThanksThe page I need help with: [log in to see the link]
The topic ‘Error calculating with dates’ is closed to new replies.