Author |
Topic |
|
gene
Starting Member
10 Posts |
Posted - March 13 2004 : 01:13:08
|
I need to list all the products with the weight of more than 1. How do I do that? shopquery.asp?weight=6 works for an exact number (6), but what about the rest?
TIA! Gene |
|
ouresolutions
Starting Member
Australia
45 Posts |
Posted - March 13 2004 : 13:46:56
|
Hi Gene, If you want products with a weight greater than 1 then I suggest you try "weight>1". If you want products with a weight of 1 or greater, then I would try either "weight>=1" or "weight=>1" - I seem to remember it is a combination of the equals and > sign but I am not sure of the order. A quick test will at least resolve for you either way.
Graeme
------------------------- Our eSolutions www.ouresolutions.com.au |
|
|
gene
Starting Member
10 Posts |
Posted - March 13 2004 : 14:47:17
|
Thanks Graeme, That exactly is my question, the obvious "shopquery.asp?weight>6" does not work. It returns ALL products, regardless of weight.
Nice try... Gene
|
|
|
gene
Starting Member
10 Posts |
Posted - March 13 2004 : 14:50:25
|
Oooops... I meant to say "shopquery.asp?weight>1" does not work. (I wrote "6" instead of "1" in my last reply)
Gene
|
|
|
Cam
VP-CART Super User
Australia
361 Posts |
Posted - March 13 2004 : 20:04:59
|
Hi Gene,
I asked VPASP support this one myself and they came back with the following:
Weight is a text field in VP-ASP and you are asking for a numeric < which will not work
Hope this provides some more info into the issue.
Cheers, Cam
************************************* Cam Flanigan YourVirtualStore Sales e-mail: http://www.vpasp.com/sales/shopcustcontact.asp web: http://www.yourvirtualstore.net Build you own YourVirtualStore!!! www.yourvirtualstore.net ************************************* |
|
|
siraj
VP-CART New User
USA
194 Posts |
Posted - March 13 2004 : 22:37:05
|
The theorically shopquery.asp?weight>=1 should work but as support mail to Cam, it should not work. As weight is varchar(20). You can try change that field to decimal/numeric and try it. I dont know what could be the knock off effect by changing the weight field. GOOD LUCK. SJ
[email protected] |
|
|
gene
Starting Member
10 Posts |
Posted - March 14 2004 : 01:40:25
|
I've changed the type to integer and it still doesn't work. Neither "shopquery.asp?weight>1" nor "shopquery.asp?weight>=2" (which should provide the same result). Either one returned the full listing. I am lost... Any other ideas?
Gene
|
|
|
support
Administrator
4679 Posts |
Posted - March 15 2004 : 02:10:13
|
Here is a small asp program thatwill do what you want. Youi cannot pass mathematical operators in a querystring (to best of my knowledge). All the file shopweight.asp (or anything you wish) Pass weight as a form or querystring
shopweight.asp?weight=5
<!-- #include file="shop$db.asp" --> <% weight=request("weight") If weight="" then weight=5 sql="select * from products where hide=0 and weight<=" & weight setsess "sql", sql response.redirect "shopdisplayproducts.asp?search=yes" %>
This technique can be used essentially for any unique SQL generation
VP-ASP Support
|
|
|
gene
Starting Member
10 Posts |
Posted - March 15 2004 : 08:10:15
|
Great! Thank you!
|
|
|
|
Topic |
|