Hi,
I'm facing with the same problem, I thing you have to define transdate in group by as below while select oprid, sum(Hours) from prodrt group by oprid, transdate where prodrt.Dimension[2] == prodTable_1.Dimension[2] && prodrt.ProdId == prodTable_1.ProdId && prodrt.TransDate < toDate But I think this not solution for your requirement. I use to create temporary table to save all data filtered by transdate and dimension Than I use group by to temporary table. You can check the return of data from your coding by adding infolog as below to make Sure data return. while select oprid, sum(Hours) from prodrt group by oprid where prodrt.Dimension[2] == prodTable_1.Dimension[2] && prodrt.ProdId == prodTable_1.ProdId && prodrt.TransDate < toDate { //start looping infolog(strfmt("Transdate %1 oprid %2 Hours %3", prodrt.transdate, prodrt.oprid, prodrt.hours)); Opening = 0; Range = 0; //to view opening select oprid, sum(hours) from prodrtJnl group by oprid where prodrtJnl.Dimension[2] == prodTable_1.Dimension[2] && prodrtJnl.ProdId == prodTable_1.ProdId&& prodrtJnl.TransDate < fromDate && prodrtJnl.oprid == prodrt.oprid; This will happened in grouping table, Is there anyone can give reason for this problem ? Hope solution above can help you Regards, tomi _____ From: Axapta-Knowledge-Village@yahoogroups.com [mailto:axapta-knowledge-vill...@yahoogroups.com] On Behalf Of bcozofu2007 Sent: Wednesday, December 17, 2008 12:02 PM To: Axapta-Knowledge-Village@yahoogroups.com Subject: [Axapta-Knowledge-Village] Fetch method Hi support, Please advice my fetch method below. I can get properly data for range date. //trying to view range but cannot if (prodrt.TransDate > fromDate && prodrt.TransDate < toDate) if(prodrt.Hours) Range = prodrt.Hours; public boolean fetch() { QueryRun qr; Boolean ret; ProdJournalRoute prodrt; ProdJournalRoute prodrtJnl; ; //Report Title reportTitle = strfmt('Weekly Rework Report as at %1',toDate); element.design().caption(reportTitle); qr = new QueryRun(element.query()); if (qr.prompt() && element.prompt()) { while (qr.next()) { ProdTable_1 = qr.get(tableNum(ProdTable)); // Opening = element.calculateOpeningBalance(); if(ProdTable_1) { //to view all W/O from prodtable while select oprid, sum(Hours) from prodrt group by oprid where prodrt.Dimension[2] == prodTable_1.Dimension[2] && prodrt.ProdId == prodTable_1.ProdId && prodrt.TransDate < toDate { //start looping Opening = 0; Range = 0; //to view opening select oprid, sum(hours) from prodrtJnl group by oprid where prodrtJnl.Dimension[2] == prodTable_1.Dimension[2] && prodrtJnl.ProdId == prodTable_1.ProdId&& prodrtJnl.TransDate < fromDate && prodrtJnl.oprid == prodrt.oprid; if(prodrtJnl.Hours) Opening = prodrtJnl.Hours; //trying to view range but cannot if (prodrt.TransDate > fromDate && prodrt.TransDate < toDate) if(prodrt.Hours) Range = prodrt.Hours; oprid = prodrt.OprId; oprname = RouteOprTable::find(prodrt.OprId).Name; element.send(prodTable_1); } /*while 2*/ } /*if*/ } /*while 1*/ } /*if*/ ret = true; return ret; } /*public*/