ganesh_kapase
9th February 2006, 10:07
Hi All

Please let me know how to count total no. of records and record number while reading particular record in below code.

select tisfc001.pdno, tisfc001.mitm, tisfc001.qdlv, tisfc001.osta,
ticst001.sitm, sum(ticst001.qucs):est.qty
from tisfc001, ticst001
where tisfc001._index2 inrange {:cprj.f,:item.f,:pdno.f} and
{:cprj.t,:item.t,:pdno.t}
and tisfc001.osta BETWEEN 5 and 7
and ticst001._index3 inrange {:rm.item.f} and {:rm.item.t}
and ticst001.pdno = tisfc001.pdno
group by tisfc001.pdno, tisfc001.mitm, tisfc001.qdlv,tisfc001.osta,
ticst001.sitm

en@frrom
9th February 2006, 10:27
In the select phrase you can add count(*):tot.rcrds or count(<table_field>):tot.rcrds, and for "record number": not sure what you mean, but if you want to know the sequence number of the record in the selectdo phrase (i.e. the first record = 1, 2nd = 2, 10th record = 10), then you should just maintain a count variable (type long), and in the selectdo you just increase the variable by 1...

Hope this helps you...

Regards,
En

ganesh_kapase
9th February 2006, 14:13
For record number I mean to say that for some tables as data is updating for each record there is one unique record no. Anyway as per your sugesstions it seems my purpose may be solved.

Thanx

for "record number": not sure what you mean, but if you want to know the sequence number of the record in the selectdo phrase (i.e. the first record = 1, 2nd = 2, 10th record = 10), then you should just maintain a count variable (type long), and in the selectdo you just increase the variable by 1...

en@frrom
9th February 2006, 16:58
I still don't quite understand, but if you say that my suggestions solved your problem, then I'm happy. If you still encounter any difficulty, feel free to ask

Regards,
En