[ic] Inactive
Ed LaFrance
edl at newmediaems.com
Mon Sep 22 12:49:02 EDT 2003
At 11:07 AM 9/22/2003 -0700, you wrote:
>On 9/22/03 10:01 AM, "Ed LaFrance" <edl at newmediaems.com> wrote:
>
> > At 09:06 AM 9/22/2003 -0700, you wrote:
> >> Can someone tell me why the following code may not be working?
> >>
> >> I'm trying to have it so that any product with the inactive field set
> to "1"
> >> doesn't show up. I was able to make it work when pulling from only one
> field
> >> but in the code below I'm pulling from two fields "Protective Gear" and
> >> "Accessories" and for some reason the inactive code isn't working.
> >> Any ideas?
> >>
> >> [table-organize embed=1 pretty=1 cols="[control cols 2]"]
> >> [loop
> >> random="[control matches 2]"
> >> search="
> >>
> >> fi=products
> >> st=db
> >> sf=prod_group
> >> se=Protective Gear
> >> op=rm
> >> nu=0
> >>
> >> os=yes
> >> sf=prod_group
> >> se=Accessories
> >> op=rm
> >> nu=0
> >>
> >> sf=inactive
> >> se=0
> >> op=ne
> >> nu=0
> >
> > The above will find records with the inactive field not equal to 0. That is
> > the opposite of what you want, try changing your se=0 to an se=1
> >
> > - Ed
> >
>
>This still doesn't work for me. Below is some code that IS working and
>following that is the code that does not work. The only difference I see is
>that on the one that is not working I am pulling from two fields as opposed
>to one.
I can see that this will be a bugger to do with the interchange search
routines. Basically what you want todo is find all records where prod_group
equals 'Protective Gear' OR prod_group equals 'Accessories' AND inactive
does not equal '1' - with the first logical comparison happening before the
second.
I have found these kinds of searches to be quite difficult to get to work
consistently with the interchange search terms, though I won't be surprise
if Mike H. or someone else follows up on my post with a perfect working
example. But the bottom line is with SQL you've nearly got it just by
describing it:
[query
type=list
random="[control matches 2]"
sql=" select sku,description,price from products where
(prod_group = 'Protective Gear'
or
prod_group = 'Accessories')
and
inactive <> '1'
order by price * 1
"]
[list]
[sql-code], [sql-param description], [sql-price]
[/list]
[/query]
- Ed L.
===============================================================
New Media E.M.S. Technology Solutions for Business
11630 Fair Oaks Blvd., #250 eCommerce | Consulting | Hosting
Fair Oaks, CA 95628 edl at newmediaems.com
(916) 961-0446 http://www.newmediaems.com
(866) 519-4680 Toll-Free (916) 961-0447 Fax
===============================================================
More information about the interchange-users
mailing list