rickwp
Starting Member
USA
3 Posts |
Posted - September 16 2002 : 02:09:12
|
I'm trying to figure out how to set up shopquery.asp to search "within a price range" instead of just "less than or equal to a price amount", but I'm not having much luck as I am new to asp and vbscript programming...
I took this section from shopquery.asp...
If Fieldtype="Currency" then if strvalue<0 then exit sub end if If not IsNumeric(strvalue) then exit sub end if if getconfig("xConvertEuropeanNumbers")="Yes" then strvalue=replace(strvalue,",",".") end if 'strvalue=Formatnumber(strvalue,2) addprefix SQL=SQL & " " & strname & "<=" & strvalue exit sub end if
and tried to replace it with...
If Fieldtype="Currency" then if strvalue<0 then exit sub end if If not IsNumeric(strvalue) then exit sub end if if getconfig("xConvertEuropeanNumbers")="Yes" then strvalue=replace(strvalue,",",".") end if 'strvalue=Formatnumber(strvalue,2) addprefix if strvalue="15" then SQL=SQL & " " & strname & "<=" & strvalue endif if strvalue="25" then SQL=SQL & " (" & strname & "<=" & strvalue & " AND " & strname & ">15)" endif if strvalue="50" then SQL=SQL & " (" & strname & "<=" & strvalue & " AND " & strname & ">25)" endif exit sub end if
Can anyone more experienced see where I am going wrong with this... it produces a "there is a problem with the page you are trying to view" error. I tried it with and without quotes around the numbers 15, 25, 50 in "if strvalue=15" lines, but got same results. I'm stumped. Any help would be greatly appreciated!
-Rick |
|