Use this if (!qr.changed(tablenum(LedgerTable)) Frankly speaking I haven't seen a way how to run an inner loop for a query. You can do it in a little bit another way,
While select legdertable While select ledgertrans where ... But it will issue a bunch of select statements, which is not ok for SQL server performance. -----Original Message----- From: Axapta-Knowledge-Village@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Roberto Pineda Sent: Friday, July 29, 2005 6:23 AM To: Axapta-Knowledge-Village@yahoogroups.com Subject: RE: [Axapta-Knowledge-Village] Question about two datasource query Thanks Dmitry... It works nice, but i think or thoght that it could be another way without checking if AccountNum has changed. I haven't found. Anyway thanks again. Roberto --- "Dyachenko, Dmitry" <[EMAIL PROTECTED]> escribió: > Hi Roberto, > > I've commented out the piece of code, which you > don't need to use. > So the on the first iteration you can retrieve the > first ltrans record, on the second iteration - the > second one. If you want to check whether accountnum > has been changed or not, you can track it by using > temp variable, or use following validation > > if (!qr.changed(tablenum(LedgerTable)) > > I hope it will help. > > > public boolean fetch() > { > QueryRun qr; > LedgerTrans lTrans; > > qr = new QueryRun(this.query()); > while (qr.next()) > { > lTrans = qr.getNo(2); > /* > while (lTrans.AccountNum) > { > info(lTrans.AccountNum); > //for example > next lTrans; > } > */ > } > } > > -----Original Message----- > From: Axapta-Knowledge-Village@yahoogroups.com > [mailto:[EMAIL PROTECTED] On > Behalf Of Roberto Pineda > Sent: Thursday, July 28, 2005 8:18 AM > To: Axapta-Knowledge-Village@yahoogroups.com > Subject: [Axapta-Knowledge-Village] Question about > two datasource query > > Hi guys. > > I have a report with two data source joined by a > relation (LedgerTable and LedgerTrans) and I need to > do > something in the fetch method like: > > public boolean fetch() > { > QueryRun qr; > LedgerTrans lTrans; > > qr = new QueryRun(this.query()); > while (qr.next()) > { > lTrans = qr.getNo(2); > while (lTrans.AccountNum) > { > info(lTrans.AccountNum); > //for example > next lTrans; > } > } > } > > But the problem is that 'next lTrans' is not allowed > in joined cursor, the question is how can I access > the second datasource (lTrans)? > > In other words, is it possible replace the below > code > with queries?: > > while select LedgerTable { > > ... > > while select LedgerTrans where > LedgerTrans.AccountNum == LedgerTable.AccountNum { > ... > } > } > > I wonder if somebody knows... thanks. > > __________________________________________________ > Correo Yahoo! > Espacio para todos tus mensajes, antivirus y > antispam ¡gratis! > Regístrate ya - http://correo.espanol.yahoo.com/ > > > Sharing the knowledge on Axapta. > Yahoo! Groups Links > > > > > > > > > __________________________________________________ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! Regístrate ya - http://correo.espanol.yahoo.com/ Sharing the knowledge on Axapta. Yahoo! Groups Links ------------------------ Yahoo! Groups Sponsor --------------------~--> <font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h4krsod/M=362131.6882500.7825259.1493532/D=groups/S=1705001380:TM/Y=YAHOO/EXP=1122657559/A=2889190/R=0/SIG=10r90krvo/*http://www.thebeehive.org ">Put more honey in your pocket. (money matters made easy) Welcome to the Sweet Life - brought to you by One Economy</a>.</font> --------------------------------------------------------------------~-> Sharing the knowledge on Axapta. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/Axapta-Knowledge-Village/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/