Dear all,
This is the original table and it is called "Dates":
Initial Date Final Date Days Permission
20/08/2015 22/08/2015
12/08/2015 30/08/2015
20/08/2015 18/08/2015
On one hand, I want to update the "Days" field with the difference (number of days) between "Final Date" and "Initial Date". On the other hand, if "Days" is greater than 15 "Permission" will be "Green", if it is between 15 and 0 "Permission" will be "Amber" and if it is lower than 0 "Permission" will be "Red". The desired result is shown below:
Initial Date Final Date Days Permission
20/08/2015 22/08/2015 2 Amber
12/08/2015 30/08/2015 18 Green
20/08/2015 18/08/2015 -2 Red
In order to achieve it, I am trying to run an update query. With the objective of making it easier, initially I just want Permission to be equal to Green if "Days">15. This is what I have done so far:
Field Days Permission
Table Dates Dates
Update to DateDiff("d",[Initial Date],[Final Date]) "Green"
Criteria DateDiff("d",[Initial Date],[Final Date])>15
I obtain the number of days but unfortunately "Permission" appears as "Green" always.
Thank you very much in advance for your help.
Best regards,
Gonzalo