In a table with:
create table
values
(cno integer not null primary key,
type char(20) not null,
date timestamp not null,
value number not null
)
You need a query with:
Select type, sum(value) as sumValue where date < ? group by type having sumValue > ?
Because the date should be selected by the user, you can not use a fixed view in the database. However, this is possible using the query element in dbforms_config.xml:
<dbforms-config> ... <query name="valuesGroup" from="values" groupBy=type> <field="type" type="char"> <field="sumValue" expression=sum(value) type="number"> <search="date" type="timestamp"> </query>
<dbforms-config> ... <query name="viewname" from="table1 left join table2 on table1.id = table2.id"> <field1 type=char> </query>