Yes, of course. This "of course" in my head might be the reason I didn't
state explicitly :) - will change.
(Exception - of course :) - if query1 is not parseable, so OOo can't
know about it's parameters.)

  
Perhaps I am not clear on what you mean by parseable. In the query builder at this time ( ver. 2.0.2 & 2.0.3.dev bld 164 ) I can create a select statement that does not need to run in 'SQL Direct' mode and does use a parameter. However, it can not be opened in the designer.

To be precise I used your example schema and added a new table named 'PriceList' as

PriceList ( ProductID [PK], EffectiveDate [PK], Price, DiscountPct )

So I can create this query in the quer builders SQL view:

SELECT
    "ProductID",
    MAX( "EffectiveDate" ) as "ChangeDate"
FROM "PriceList"
    WHERE "EffectiveDate" <= CURRENT_DATE
    AND "ProductID" = :pid
    GROUP BY "ProductID"    

The query runs fine, the parameter is prompted for and replaced. The query will not open in the designer ( I know a bug I suppose ). But I want to be sure I understand you. This is being parsed correct? Therefore I could bring thie query holding this statement into a new query, even with the designer not working with it?

Drew

Reply via email to