Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: ) missing.... but where

Geek News

) missing.... but where
Jean-Paul <jp.dewinter[ at ]telenet.be> 12/18/2008 11:14:12 AM
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
RE: ) missing.... but where
RonaldoOneNil 12/18/2008 11:32:01 AM
To close your Month function
schljaar=IIf(Month(Date()) .....

"Jean-Paul" wrote:

[Quoted Text]
> 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
>
Re: ) missing.... but where
"boerkees" <u48264[ at ]uwe> 12/18/2008 1:31:19 PM
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


Jean-Paul wrote:
[Quoted Text]
>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

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net