Page 1 of 1

Simple query builder

Posted: Tue Aug 25, 2015 7:15 am
by skiman
Hi,

I need a very simple query builder for reports. I want a builder as for the following sample.

Report with 3 columns.
Column one: country
Column two: sales
Column three: year

I want it to be possbile for a user to have a query as 'sales > 1000 .and. year = 2015'.

When I evaluate the query, I can use strtran(cQuery,'sales','sales->amount').

My problem is that I haven't any control for building the query. I checked the dc_querybuild(), but this needs an open database. My user doesn't know in what field the data is in. He only sees the header of my browse which isn't the same as my fieldname.

I'm looking for something as cQuery := MakeSimpleQuery( aStructure). According to Type of an element (Character, Numeric, Data, Logical) the result of the query should be as in dc_querybuild.

I was hoping that dc_querybuild( "","","", aStructure) would work, but it tries to start a dcbrowse.

Is there maybe a dc_xxx function which is not documented for this purpose?