) missing.... but where

J

Jean-Paul

schljaar=IIf(Month(Date() Between 9 And 12 , Year(Date()) & "-" &
Year(Date())+1 , Year(Date())-1 & "-" & Year(Date()))

returns an error saying there is a ) missing...

Can anybody help?
Thanks
 
B

boerkees

Hi Jean-Paul,

I never use the editing (im)possibilities of Access but some programmers
editor. There are plenty. I use Notepad++ wich does highlighting on keywords
en on corresponding parenthesis '()', '{}' as well as '[]'.
I would use it for your formula like this:

schljaar=IIf
(
(Month(Date()) Between 9 And 12)
, (Year(Date()) & "-" & Year(Date())+1)
, (Year(Date())-1 & "-" & Year(Date()))
)

I always (well allmost allways) use parenthesis around almost anything that
should be taken as an unit.

IIF has 3 elements:
IIF((condition), (expression if true), (expression if false))
Your conditionparts reads:
Month(Date() Between 9 And 12
You wil count 2 times '(' and 1 time ')' so the closing parenthesis right
after the one of Date() is the one that is missing
Month(Date()) Between 9 And 12
would be correct.

Finally, studiing Lisp pays of; the nickname of lisp being Lots of Irritating
Single Parenthesis...

Rgards,

Kees de Boer
Beverwijk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top