To make thing more complicated (but readable) try a select case true...

Select Case true
        Case Coverday < 0
                bgcday = "red"
                days0 = days0 + 1
        Case CoverDay < 45
                bgcday = "#2068c0"
        days045 = days045 + 1
        Case CoverDay =< 60
                bgcday = "green"
                days4560 = days4560 + 1
        Case CoverDay > 60
                bgcday = "yellow"
                days60 = days60 + 1
End Select

-bill

-----Original Message-----
From: Josh G [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, October 02, 2002 3:11 AM
To: ActiveServerPages
Subject: Re: Lost in Time: If ... then


there's your problem - in vb, you don't use else if, you need elseif.
else if is valid code, so you won't syntax error out, but it means
something different.

if Coverday < 0 then
    bgcday="red" and days0=days0+1
elseif CoverDay > 0 and CoverDay < 45 then
    bgcday="#2068c0"
    days045=days045+1
elseif CoverDay >= 45 and CoverDay =< 60 then
    bgcday="green"
    days4560=days4560+1
elseif CoverDay > 60 then
    bgcday="yellow"
    days60=days60+1
end if

Your code may work, but you would need 4(?) "end if"s at the end, and
it's _very_ hard to read. In this case a select would have been a better
idea.

-Josh
--



---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to