Hi,

Have you resolved?  If not, you can try it.

Replace the strRange sentence like below:

strRange = strfmt('(%1 == "%2") || (%3 == "%4")',prodtable.dimension
[1],'admin',prodtable.dimension[2],'fina');

Regards,




--- In [email protected], "Agus Riyadi"
<[EMAIL PROTECTED]> wrote:
>
> Dear All,
>
> There have been a lot of discussion about query with or, but I
don't
> find one that address to array field.
>
> I have a query like this, which I need to change it to a query
> object :
>
> select prodtable where prodtable.dimension[1] == 'admin'
>         || prodtable.dimension[2] == 'fina';
>
> I tried this job to buid a query object :
>
> static void job11(Args _args)
> {
>
>     ProdTable                   ProdTable;
>     QueryBuildDataSource        ds;
>     Query                       q;
>     QueryRun                    qr;
>     QueryBuildRange             range;
>     Str                         strRange;
>     ;
>    
>     q = new Query();
>     ds = q.addDataSource(tablenum(ProdTable));
>     range = ds.addRange(fieldnum(ProdTable,Dimension));
>
>     strRange = strfmt('(%1 == "%2") || (%3 == "%4")',
>         'dimension[1]','admin',
>         'dimension[2]','fina');
>
>     range.value(strRange);
>
>     qr = new QueryRun(q);
>
>     while(qr.next())
>     {
>         PRODTABLE = qr.getNo(1);
>         info(prodTable.ProdId);
>     }
>
> }
>
> But an error raised :
>
> Query extended range failure: Right parenthesis expected near pos
0.
>
>
> Can anyone give a clue to correct that code, or there any
> alternatives ?
> Thanks for any comments.
>
>
> Regards,
>
> Agus
>









SPONSORED LINKS
Computer part Programming languages Microsoft axapta
Support exchange


YAHOO! GROUPS LINKS




Reply via email to