VishalMistry
15th May 2007, 14:44
Hi all,

We are on Baan IVc4 on win 2003/MS SQL2000 and learning Baan tools programming. While creating a print session, we are specifying criteria on the form for the records which are to be printed. Is there any way to know the number of records selected in the SQL statement (like recordcount property of ADODB recordset in Visual basic).


Thanking in advance,
Vishal

george7a
15th May 2007, 15:01
Hi,

Yes there is. You can use the count function in the select statement. Read about it in the following link:
http://www.baanboard.com/programmers_manual_baanerp_help_functions_database_handling_select

Example:

| This SQL searches all the POs and returns how many times did the item 28712 appear
| The answer will be saved in item.count
select count(tdpur041.item):item.count
from tdpur041
where tdpur041.item = " 28712"
selectdo
| You can also add a counter here
endselect
I hope it helps,

- George