Question for anyone out there...
I have a query that has been working like a champ for several months. But, suddenly last week, it stopped, giving me an Incorrect or Too Complex error (#3071).
I've narrowed it down to one field that is causing the problem; a formula that takes a date, breaks it down into its component DMY values, adds 1 to the year and then puts it back to a date.
The error comes up whether I run this expression as part of a larger query or all by itself.
Funny thing is, though - aside from the fact that it was working just fine up until about Tuesday of last week - I have the exact same expression in another field in the same query that works fine, the only difference is that it adds 2 to the year, rahter than 1.
Here's the code that works;
Here's the code that fails;
The only difference - aside from the label - is the failed code adds 1 to the year and the working code adds 2.
Now, if I leave off the CDate() part, both work fine. But, I'm left with a string result, rather than a date. I might be able to live with that, but I can see no reason why this function worked prior to last Tuesday and then suddenly went belly-up.
I've tried reinstalling Access, but no dice.
Any ideas?
I have a query that has been working like a champ for several months. But, suddenly last week, it stopped, giving me an Incorrect or Too Complex error (#3071).
I've narrowed it down to one field that is causing the problem; a formula that takes a date, breaks it down into its component DMY values, adds 1 to the year and then puts it back to a date.
The error comes up whether I run this expression as part of a larger query or all by itself.
Funny thing is, though - aside from the fact that it was working just fine up until about Tuesday of last week - I have the exact same expression in another field in the same query that works fine, the only difference is that it adds 2 to the year, rahter than 1.
Here's the code that works;
Code:
2yr_svcpaydate: CDate(format(Month([Active Personnel]![svcpaydate]),"0")+"/"+format(Day([Active Personnel]![svcpaydate]),"0")+"/"+format(Year([Active Personnel]![svcpaydate])+2,"0"))
Here's the code that fails;
Code:
1yr_adjpromdate: CDate(format(Month([Active Personnel]![adjpromodate]),"0")+"/"+format(day([Active Personnel]![adjpromodate]),"0")+"/"+format(year([Active Personnel]![adjpromodate])+1,"0"))
The only difference - aside from the label - is the failed code adds 1 to the year and the working code adds 2.
Now, if I leave off the CDate() part, both work fine. But, I'm left with a string result, rather than a date. I might be able to live with that, but I can see no reason why this function worked prior to last Tuesday and then suddenly went belly-up.
I've tried reinstalling Access, but no dice.
Any ideas?