1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

IF / ELSE / OR Statement problems

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

  1. #1
    Hi all,
    SEMrush
    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
    SEMrush
  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