
September 22nd, 2005, 03:19 AM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 8
Time spent in forums: 51 m 37 sec
Reputation Power: 0
|
|
|
Problems with simple 'IF' statement
Can someone please shed some light on why the below code won't work?? It's driving me a bit mental!
What i'm trying to do is to color code various cells of a table depending on its value. I have a customer id and a product id and am calculating percentages of job completion based upon products given individual product id's. Problems i think appear to be arising not only due to errors in the code but also as a result of having no product id's for customers. How can i fix this?
<% If objProduct("AVGENQUIRYRECEIVED").Value >= 0.6 AND OBJPRODUCT("AVGENQUIRYRECEIVED") <= 1 THEN %><%="<TD BGCOLOR=#66DAA>"%><%ELSE IF OBJPRODUCT("AVGENQUIRYRECEIVED") < 0.6 AND OBJPRODUCT("AVGENQUIRYRECEIVED") >= 0.3 THEN%><%="<TD BGCOLOR=#FF6347>"%><%ELSE%><% IF OBJPRODUCT("AVGENQUIRYRECEIVED") < 0.3 AND OBJPRODUCT("AVGENQUIRYRECEIVED") >= 0 THEN%><%="<TD BGCOLOR=#FFA500>"%><%END IF%><%END IF%><%END IF%><%= FORMATPERCENT((OBJPRODUCT("AVGENQUIRYRECEIVED").VALUE), 0, -2, -2, -2) %>
Thanks in advance,
J.
Manchester, UK.
|