[thelist] sql filtering problem
dn at dittodesign.co.uk
dn at dittodesign.co.uk
Tue Aug 27 09:56:01 CDT 2002
*confused* this seems like an answer to a previous post which I haven't
received ?
> >WHERE Brand LIKE 'aeg' and Product_Type LIKE 'Microwave'
I can see how that would work. I should of explained in a little
more detail.
the results page url -
brand_product.asp?Product_Type=Microwave&Brand=aeg
is the result of choices made over two pages each containing
a drop box. So case is not an issue.
I need to filter the result page by the two variables in the url.
Nothing I've tried so far has done the trick. It must be something
real simple but being a newbie with asp its rather difficult to spot.
At the moment I'm throwing everything I can think of at the problem.
> J -by Darren included references to the % (wildcard) token,
oops changed that to '1' I was using LIKE to try and solve the problem
and left the % in there.
any more ideas welcome, please =8-)
Darren Yates
dn at dittodesign.co.uk
http://dittodesign.co.uk
----- Original Message -----
From: "Christopher Joseph" <Christopher at ideadesigners.com>
To: <thelist at lists.evolt.org>
Sent: Tuesday, August 27, 2002 3:08 PM
Subject: RE: [thelist] sql filtering problem
> > >The resultant SQL you want is:
> >
> > >SELECT Brand_Logo, Brand_Logo_sml, ID, Product_Type, Brand, Model,
> > >Reference_No, Colour, image, Retail_Price, Delivery_Charge
> > >FROM kitchen_appliance
> > >WHERE Brand LIKE 'aeg' and Product_Type LIKE 'Microwave'
> >
> > Confused!
> >
> > Why would you use LIKE as a filter if your Brand and Product_Type
columns
> > are not going to contain variant data? i.e These columns should contain
> > known values shouldn't they.
>
> J -Technically you could use simple equality if the product type is known
to
> be
> J -100% correct and the CaPiTaLiZaTiOn is correct. "aeg" is certainly not
> the
> J -correct brand name. It's more likely "AEG"--or something similar. The
> LIKE
> J -operator tends to be case-insensitive, which in this case could be a
good
> J -thing. And, I also opted for LIKE in this case is because the code
> supplied
> J -by Darren included references to the % (wildcard) token, which only
makes
> J -sense using LIKE.
>
> J -Also, variant data has nothing to do with SQL really. The LIKE is for
> J -marking partial matches against strings.
>
> Thanks.
>
> Sorry for the confusion regarding the term 'variant data' I meant 'data
that
> is not a known set of values' and NOT variant datatypes.
>
> I agree the use of LIKE is warranted in a situation where the end user
might
> be responsible for entering the filter terms and situations like
> CaPiTaLiZaTiOn occur but I couldn't determine from the original emailed
code
> whether or not wildcards were being used (but then I cannot code in CF so
I
> wouldn't know my @rse from my elbow :)). Out of interest how is the
wildcard
> used in the original CF code?
>
> Chris.
>
>
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
More information about the thelist
mailing list