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 <[EMAIL PROTECTED]> 
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]
>


Reply via email to