Something new in access 2010?

rainman89

I cant find the any key..
Local time
Today, 06:51
Joined
Feb 12, 2007
Messages
3,015
Does anyone know why access 2010 would not be able to handle this where statement?

WHERE ((([dbo_Calendar].[endYear])=IIf(Month(Now())>=7,((Year(Now())+1)),((Year(Now()))))))

I get a compile error . in query expression, but 2007 handles it just fine!
 
Though the brackets seem to be in the 'right place' boy wow a lot of brackets...

And though not a real answer, try this without an IIF:
Year(date() ) + abs(Month(Date()) > 6)
 
Though the brackets seem to be in the 'right place' boy wow a lot of brackets...

Yeah I probably could have cleaned it up alittle bit..... sorry about that.

And though not a real answer, try this without an IIF:
Year(date() ) + abs(Month(Date()) > 6)

When I try this I get

"There was an error compiling this function. The visual basic module contains a syntax error."

Then It highlights "Year"
 
Check Tools -> References in the VBA editor. Do you have any missing reference? This sounds like a case of something AWOL...
 
I have the following, I'm not sure I see anything missing...
VB for Applications
Access 14.0 object library
OLE Automation
Microsoft Activex
Office 14.0 access database engine object library
 
This one:
Office 14.0 access database engine object library

is the new DAO and you might try unchecking it, closing things and then reopening and checking it again (if it will even let you uncheck it, which I don't know if that is possible).
 
Unchecking it didn't seem to work... and I can't uncheck them all because some are in use.
 
Well, have you tried importing everything into a new, blank database shell?
 
Just did, from a 2000 format to a 2007 format and now the query works...

I'm curious as to why It wont work as is, seeing as in access 2007 it works just fine...
 
Hard to say - sometimes things just seem to hit a snag.
 

Users who are viewing this thread

Back
Top Bottom