Is there a reason why you are trying to do this using the Query
structure? Why not use
While
Select ProdTable
Where (ProdTable.dimension[1] == 'Admin' || ProdTable.dimension[2] ==
'fina')
{
.....
}
Barry.
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of ozzage
Sent: Tuesday, 7 February 2006 6:47 PM
To: [email protected]
Subject: [development-axapta] Re: query with or array field
Hi Agus
I have never seen a solution to your problem. As far as I know, it's
simply not possible to reference array fields when utilising the
extended query syntax.
I live in hope that somebody will correct me :)
Regards
Andrew Jones
--- In [email protected], Agus Riyadi <[EMAIL PROTECTED]>
wrote:
>
> Hi Solary,
>
> I sill haven't solved the problem.
> Thanks for your reply, but that won't work since the first and third
> parameter for strfmt will be blank because it is supplied with blank
value
> rather than column name. When I change it to colum name -which the
same as
> the first job I posted- it raises query extended failure.
>
> Regards,
>
> Agus
>
>
> On 2/6/06, solary_luo <[EMAIL PROTECTED]> wrote:
> >
> > 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"
> > <agusacil@> 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
> > >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
> [Non-text portions of this message have been removed]
>
Yahoo! Groups Links
SPONSORED LINKS
| Computer part | Programming languages | Microsoft axapta |
| Support exchange |
YAHOO! GROUPS LINKS
- Visit your group "development-axapta" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

