IF / ELSE / OR Statement problems

Discussion in 'C#' started by bazzanoid, Feb 28, 2007.

  1. #1
    Hi all,

    I'm having a trouble with my if/else/or statement. The below is a cut-down version as it's got a lot of ElseIfs... if someone could point out my errors i would appreciate it!!! It never returns the correct response, always defaults to the Else... Full version can be found at www.rtd.uk.com/productmain.txt if you wish to see it.

    <% If rstSearch.Fields("category") = "FT" And (rstSearch.Fields("UnitPrice") > 0 And rstSearch.Fields("UnitPrice") < 200) And (warranty = "1") Then %> <option value="YIQAW 3 Yr Total Warranty:79:1">3 Years Total Warranty £79</option><option value="YIQAW 5 Yr Total Warranty:119:1">5 Years Total Warranty £119</option> 
    
    <%ElseIf (rstSearch.Fields("category") = "FU" Or rstSearch.Fields("category") = "BE")  And (rstSearch.Fields("UnitPrice") > 0 And rstSearch.Fields("UnitPrice") < 200) And (warranty = "1") Then %> <option value="YIQDW 3 Yr Total Warranty:44:1">3 Years Total Warranty £44</option><option value="YIQDW 5 Yr Total Warranty:79:1">5 Years Total Warranty £79</option>
    
    <% Else %><option value="">Sorry, no extended warranty available</option> <% End if %>
    Code (markup):
    Thanks!
     
    bazzanoid, Feb 28, 2007 IP
  2. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #2
    put another elseif in place of else
     
    ludwig, Feb 28, 2007 IP