Hi Did you try to debug the code and see in which line it creashes? And what kind of error message axapta shows after crash?
I also declare QueryBuildDataSource in fetch method and add the query to it - for seeing the SQL select in debuger watch. It is very useful when building queries. Please send how it went br Ingus Ziedinsh --- In development-axapta@yahoogroups.com, Jorge HS <[EMAIL PROTECTED]> wrote: > > Hi Ingus, > > Thanks for your response. > > I try with it, but still the problem. Is very strange the problem, because it happen only with a certain period, but if I put dates in wich this period are between, the problem not occur (the problem is between 01/08/2007..31/08/2007; but, for example, between 01/07/2007..31/08/2007 works ok). > > Any other idea?? > > Equally thanks again for your help. > > The last solution will be replace the query by the classic select...it is not the best but works. > > > Jorge > > > > > "ingus.ziedins" <[EMAIL PROTECTED]> escribió: > Hi > > Try few things: > 1. Try to make a new query with newly declared tables > Do not use element.query(); > because there are existing queryRun element.queryRun() which could be > conflicting with your new queryRun > > 2. Use SysQuery::valueNotEmpty() instead of strfmt("!= %1", '""') > giving a string to SQL sometimes conflicts and crashes > > 3. Also try SysQuery::range(FromDate, ToDate), but I think that is > not the case > > Did it help? > > --- In development-axapta@yahoogroups.com, Jorge HS <jorgehs_08@> > wrote: > > > > Hi everybody, > > > > I have a problem with a query in a report. > > > > In the report i have a simple query with tables custinvoicejour > and custinvoicetrans, in the fetch method i run the query and fill a > temporary table, the i use the temporary table for the report. > > > > The code are: > > > > > element.query().DataSourceTable(TableNum (CustInvoiceTrans)).addRange(fieldnum(CustInvoiceTrans, > InvoiceDate)).value(queryRange(FromDate,ToDate)); > > > element.query().DataSourceTable(TableNum (CustInvoiceTrans)).addRange(fieldnum(CustInvoiceTrans, > SalesId)).value(strfmt("!= %1", '""')); > > > > qr = new QueryRun(element.query()); > > > > while (qr.next()) > > { > > CustInvoiceJour = qr.get(tablenum(CustInvoiceJour)); > > CustInvoiceTrans = qr.get(tablenum(CustInvoiceTrans)); > > etc... > > etc... > > } > > > > > > I run this report for a period of time (from date ... to date). > > > > I have a problem when put a certain period, for example 01/08/ > 2007 to 31/08/2007. If i request this period, when the "qr.next()" > execute, this hang axapta, never enter in the while sentence. > > > > With others periods i not have problems. Furthermore if i request > a period greater (01/07/2007 to 31/08/2007) it work Ok. > > > > I don´t have idea what happens. If I do an "While Select" with > the tables in the mentioned period (august) it work ok. > > > > Only with the Query in that period hang axapta. > > > > Someone know this issue?, some idea for solve it using the > query??? > > > > Thanks in advance to everyone for the help. > > > > > > > > Jorge > > > > Note: I have Axapta 3.0 with SP4 > > > > > > > > > > > > --------------------------------- > > > > Los referentes más importantes en compra/venta de autos se juntaron: > > Demotores y Yahoo!.Ahora comprar o vender tu auto es más fácil. > > Visitá http://ar.autos.yahoo.com/ > > > > [Non-text portions of this message have been removed] > > > > > > > > > --------------------------------- > > Los referentes más importantes en compra/venta de autos se juntaron: > Demotores y Yahoo!.Ahora comprar o vender tu auto es más fácil. > Visitá http://ar.autos.yahoo.com/ > > [Non-text portions of this message have been removed] >