Hi All
I'm trying to set a day count based on the number of days in the year and take account of possible leap years. The table only ever contains a years cumulative data and the day count needs to run from the first of April and be flexiable enough not to need maintenance to account for a new year. I've witten the below which works fine in a select query butI get a not updateable error in the update?
Please can anyone advise how to correct this so it will work?
Many thanks
Dominic
I'm trying to set a day count based on the number of days in the year and take account of possible leap years. The table only ever contains a years cumulative data and the day count needs to run from the first of April and be flexiable enough not to need maintenance to account for a new year. I've witten the below which works fine in a select query butI get a not updateable error in the update?
Code:
UPDATE Pharmacy SET Pharmacy.MRN = "UK" & (DateSerial((select year(min([RIODate])) from Pharmacy)+1,3,31)-DateSerial((select year(min([RIODate])) from Pharmacy),4,1))-(DateSerial((select year(min([RIODate])) from Pharmacy)+1,3,31)-[RIODate])+1;
Please can anyone advise how to correct this so it will work?
Many thanks
Dominic