I created the following query in MS ACCESS:
"UPDATE dbo_PricingFutures
SET dbo_PricingFutures.ttm =
DateDiff('m',dbo_PricingFutures.PricingDate,DateSerial(dbo_PricingFutures.PricingYear,dbo_PricingFutures.PricingMonth,14));"
When I run the query, which should calculate the difference between dates. It says it is going to update the records:
However the fields in the column stay empty. I don't understand why?
By a mistake, the column pricingdate was empty. I ran the following vba code:
Then I got an error on the following line:
It showed that the column PricingDate was empty. Then, I took data from an old back up, copy/pasting in the column PricingDate and it worked perfectly.
The SQL code was running without showing error.