Dynamic Reports in PostgreSQL

Tim <[email protected]>
Newsgroups gmane.comp.openoffice.dba.user
Message-ID <[email protected]>
Hi,
I am having trouble with a dynamic report.  I wanted to bounce this off 
of this list before making it an issue.
The facts:
Windows XP
OOo 2.1
postgresql 8.1
postgresql-sdbc-0.7.2

I have a query that works fine in postgresql.
It works in Base fine when using sql directly.  It breaks in sql designer.
This sql statement worked fine in the earlier version of Base, but 
doesn't now.  (Which is another "issue." When is "Base SQL" going to 
become ANSI SQL compliant? )

SELECT
    t1.xref AS "Xref",
    t1.post_date AS "Date",
    t1.account AS "Account",
    t1.description AS "Description",
    t1.debit AS "Debit",
    t1.credit AS "Credit",
    SUM(t2.credit) - SUM(t2.debit) AS "Balance"
FROM test t1, test t2
WHERE t1.id >= t2.id
GROUP BY t1.id, t1.xref, t1.post_date,t1.account, t1.description, 
t1.debit, t1.credit
ORDER BY t1.id

This gives me a running balance in standard SQL.
In the report wizard, a static report can be created using this query.  
It fails in making a dynamic report.
Is this because it converts it to "Base SQL"?
Below is what happens when Design View is turned on then off:

SELECT
    "t1"."xref" AS "Xref",
    "t1"."post_date" AS "Date",
    "t1"."account" AS "Account",
    "t1"."description" AS "Description",
    "t1"."debit" AS "Debit",
    "t1"."credit" AS "Credit",
     SUM( "t2"."credit" ) - SUM( "t2"."debit" ) AS "Balance"
FROM
    "public"."test", "public"."test"  --public is the schema(folder) for 
the database in Postgres
GROUP BY "t1"."id", "t1"."credit", "t1"."credit", "t1"."credit", 
"t1"."credit", "t1"."credit", "t1"."credit"
HAVING ( ( "t1"."id" >= "t2"."id" ) )
ORDER BY "t1"."id"
ASC

Any feedback would be appreciated.

Thanks,

Tim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.