Parenthesis and comma status

R

Rose

Can anyone figure out where the parenthesis and comma's might be wrong below?

Nights: IIf(DateDiff("d", IIf(CheckInDate < [Start Date],
[Start Date], IIf(Nz(CheckOutDate, Date()) > [End Date],
[End Date], Nz(CheckOutDate, Date()))) = 0, 1),
DateDiff("d", IIf(CheckInDate < [Start Date], [Start Date],
IIf(Nz(CheckOutDate, Date()) > [End Date], [End Date],
Nz(CheckOutDate, Date()))
 
J

Jeff Boyce

Rose

When I end up with one of these, I start counting, adding 1 for each left
paren and subtracting for each right paren ... ditto for other brackets.

I do have a question about this phrase:
IIf(Nz(CheckOutDate, Date()) > [End Date],
[End Date], Nz(CheckOutDate, Date()))) = 0, 1)
which seems to have an extra "=0" in the "false" side of the IIF().

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
R

Rose

Thanks for your help and clever way to check the , and )
--
Rose


Jeff Boyce said:
Rose

When I end up with one of these, I start counting, adding 1 for each left
paren and subtracting for each right paren ... ditto for other brackets.

I do have a question about this phrase:
IIf(Nz(CheckOutDate, Date()) > [End Date],
[End Date], Nz(CheckOutDate, Date()))) = 0, 1)
which seems to have an extra "=0" in the "false" side of the IIF().

Regards

Jeff Boyce
Microsoft Office/Access MVP

Rose said:
Can anyone figure out where the parenthesis and comma's might be wrong
below?

Nights: IIf(DateDiff("d", IIf(CheckInDate < [Start Date],
[Start Date], IIf(Nz(CheckOutDate, Date()) > [End Date],
[End Date], Nz(CheckOutDate, Date()))) = 0, 1),
DateDiff("d", IIf(CheckInDate < [Start Date], [Start Date],
IIf(Nz(CheckOutDate, Date()) > [End Date], [End Date],
Nz(CheckOutDate, Date()))
 

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