Haggis
20th February 2003, 18:02
Hi

I posted a question a while ago about this and got some solutions, then got pulled onto another project so have only returned to this problem now.

Basically I created a display session that shows sales orders and their weights. The problem I have is that I need to exclude sales orders in the display where tdsls401.clyn = "yes". The solution I got last time was to use query.extension = "tdsls401.clyn = tcyesno.yes"

It compiles but gives me a syntax error in expression message. I have the feeling this is because the table tdsls401 is not part of the underlying select statement Baan generates. But am I correct is saying query.extension only accesses the WHERE part of the Select statement? Is there a way to add that table or am I barking up the wrong tree and my syntax error is because of something else?

I can post the error message as it stands if need be.

Thanks

nick_rogers
20th February 2003, 18:08
the query extension is only applicable to sessions that have a main table, and I do believe can only be used for filtering on the specific main table.

so if the main table is tdsls040, the query extention can only be used on the tdsls040.

dnnslbrwn
20th February 2003, 20:31
Could you ...

query.extension = " exists ( select tdsls401.* from tdsls401 where tdsls401._index1 = { tdsls040.orno } and tdsls401.clyn = tcyesno.yes )"

I am just guessing at the index of table tdsls401... adjust accordingly.

Just a thought.

-Dennis

lbencic
20th February 2003, 22:45
The Baan V and Baan IV options for query extensions are different. In Baan V, you can extend the select, from and where clauses, and so filter based on conditions on a table other than your main. Syntax is different per version.


http://www.baanboard.com/baanboard/showthread.php?s=&threadid=5536&highlight=query.extend

kevobr
21st February 2003, 11:28
If sls401 is your main table then:

query.extend.where ("tdsls401.clyn <> tcyesno.yes" )


Or if tdsls400 is main table:

query.extend.where (" exists ( select tdsls401.* " &
"from tdsls401 " &
"where tdsls401._index1 = {:tdsls400.orno}" &
"and tdsls401.clyn <> tcyesno.yes) ")