Subject Re: Filter problem
From Charlie <tm@tc.com>
Date Sat, 29 Mar 2025 04:40:34 -0400
Newsgroups dbase.getting-started

Thanks Heinz and Mervyn...

I actually figured this out after your hint, Heinz.  The 'group by' threw me off.

sql = "SELECT category, SUM( qty * estv ) AS catval FROM COLLECTION group by category"

I had been using xdml functions for this.  But oodml and xdml do not mix well when deleting so this fixes that problem.


Heinz Kesting Wrote:

> Hi Charlie,
> > I am having a problem filtering this.  I've tried different attempts including params with no luck.
> >
> > sql
> >     this.COLLECTION6 = new QUERY(this)
> >     with (this.COLLECTION6)
> >        left = 448.0
> >        width = 64.0
> >        height = 37.0
> >        database = form.coindata1
> >        sql = "SELECT SUM(qty * estv) AS catval FROM COLLECTION"
> >        active = true
> >     endwith
> >
> > variable:
> > fltr = trim(form.category1.rowset.fields["cat"].value)
> >
> > one of several attempts at a filter:
> > form.collection6.rowset.filter = [category ='] + fltr + [']
> > form.entryfield6.value = form.collection6.rowset.fields["catval"].value
> >
> > This gives me 'undefined: category'
> >
> > Any help would be appreciated!
>
> If I understand your code correctly, you are trying to set a filter on
> values in the field CATEGORY in the rowset FORM.COLLECTION6:
>
> form.collection6.rowset.filter = [category ='] + ....
>
> but the only field in the rowset is CATVAL, according to your SELECT
> statement.
> So to me it seems as if the error is saying there is no field CATEGORY
> to compare the filter value FLTR with?
>
> Just my two cents, but hope it helps?
> Kind regards, Heinz
>
>
> --
> Diese E-Mail wurde von Avast-Antivirussoftware auf Viren geprüft.
> www.avast.com