iif expected end of statement

C

Cristen

Hello. I'm trying to use this code that omits weekend days from a date
calculation. I get an Expected: end of statement error. I am not sure what
to do. I took this code off of another post I found on this site. so I am
not too advanced at this. Thanks!

..iMin = DateDiff("d", sPrevDate, sAppDate) - _
DateDiff("ww", sPrevDate, sAppDate, vbSunday) * 2 _
IIf(Weekday(sAppdate, vbSunday)= vbSaturday, _
IIf (Weekday(sPrevDate, vbSunday) = vbSaturday, 0, 1), _
IIf (Weekday(sPrevDate, vbSunday) = vbSaturday, -1, 0))
 
D

Dirk Goldgar

Cristen said:
Hello. I'm trying to use this code that omits weekend days from a date
calculation. I get an Expected: end of statement error. I am not sure
what
to do. I took this code off of another post I found on this site. so I am
not too advanced at this. Thanks!

.iMin = DateDiff("d", sPrevDate, sAppDate) - _
DateDiff("ww", sPrevDate, sAppDate, vbSunday) * 2 _
IIf(Weekday(sAppdate, vbSunday)= vbSaturday, _
IIf (Weekday(sPrevDate, vbSunday) = vbSaturday, 0, 1), _
IIf (Weekday(sPrevDate, vbSunday) = vbSaturday, -1, 0))


It seems to me that there should be an operator of some kind after the 2 in
this line:
 

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