duendezon
26th March 2003, 07:13
Hello everyone

I'm a newbie in developing in Baan IV.

I have two questions

1.- How can I build a subquery inside the main select statement?, something like this

select tdsls051.*,
(select max(tdpur051.ddtc)
from tdpur051
where tdpur051.ckor = 3
and tdpur051.item = :tdsls051.item)
from tdsls051
where tdsls051.ttyp = "VFA"
and tdsls051.ckor = 3
and tdsls051._index8 between {:fechafac.f} and {:fechafac.t}
and tdsls051.item between :articulo.f and :articulo.t

In MS SQL Server the sentence above will run without any problems but when I compile my program in Baan IV I get the following error message:

ptdsls94080(67): Error SQL: Syntax error: '(' not expected
ptdsls94080(62): Error SQL: Found 1 error during scanning/parsing... stopped.

1 Warning suppressed due to errors
2 errors reported.

So, anyone can give some hints to solve this?, thank you

2.- Where I can found some information about programing wiht Baan IV, how can I improve the performance of my Baan SQL statements.

Thank you for the help.

Read you soon!!

sanjaykathuria
26th March 2003, 08:49
Dear NewBie,

:rolleyes:
Solution 1:
There was some problem in query syntex.I am sening correct on. Please check it.
select tdsls051.*,
from tdsls051
where tdsls051.item in (select max(tdpur051.ddtc)
from tdpur051
where tdpur051.ckor = 3
and tdpur051.item = :tdsls051.item)
and tdsls051.ttyp = "VFA"
and tdsls051.ckor = 3
and tdsls051._index8 between {:fechafac.f} and {:fechafac.t}
and tdsls051.item between :articulo.f and :articulo.t

Solution 2:

You can download this documen from www.baan.com or baan itself has complete help of programing syntex and SQL.

Best Regards
Sanjay Kathuria

duendezon
28th March 2003, 07:58
Thank you soo much I'll check it out later.