Rebecca wrote:
I am using OpenOffice.org 2.4 and have created a database. I created a query based on the table so that I can see the data of one specific month at a time. For example, in the Criterion Line I have put "BETWEEN 01/05/2008 AND 31/05/2008" and this will print out all records or May. I created a report based on this query, but when I change this one criterion line in the query it does not show up in the Report.
Is there a way to fix this?
Rebecca
Hello Rebecca,

Using version 2.4 the report wizard uses the name of the query the report is based by on extracting the SQL select statement from it, then writing this statement into a hidden control on the form document. When the report is generated it is this copied SQL statement that is actual used, not the query object.. This is why when you change the Query then run the report the again the change is not reflected.

One way around this is to use named replacement parameters in your query, as these will be copied when the report is created the system will prompt for the values to use when the report is generated. This will require that you alter the way you setup the Query then. Instead of using BETWEEN you would need to use to fields one being >= and the other <=.

For example:

If your original query where

SELECT * FROM "Table1"
WHERE "DateCol" BETWEEN #01/05/2008# AND #31/05/2008#

the altered query would be

SELECT * FROM "Table1"
WHERE
 "DateCol" >= :StartDate
AND
 "DateCol" <= :EndDate

Now if you create a dynamic report from this query when the report is run a dialog box will pop up and ask the user for the StartDate and EndDate values to use.

I HTH

Drew




--
OpenOffice.org User Community Forum: http://user.services.openoffice.org
United States PostgreSQL Association: http://www.postgresql.us/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to