While the following works for fixed values, has anyone managed to make this work with wildcards????  (Each time I've tried, I received an error 'Query extended range failure: Right parenthesis expected ...')


Barry.

-----Original Message-----
From: development-axapta@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Zekveld
Sent: Tuesday, 6 December 2005 12:15 AM
To: development-axapta@yahoogroups.com
Subject: Re: SV: [development-axapta] Query to 'OR' two ranges

Thanks! I got it to work.

for those who will be trying the solution below:

I couldn't get it to work with 'Person.Age' as is used in the
example below. Leave out the table name if you are only working in
one table, then it works. Otherwise you get a error message
indicating that the datasource.field is incorrect. The way I got it
to work is as follows

queryBuildDataSource = query.addDataSource(tableNum(Table1));
queryBuildRange      = queryBuildDataSource.addRange(fieldNum
(Table1, Field1));
tmpStr = strFmt('((Field1 == noyes::Yes) || (Field2 ==
noyes::Yes))'); // noyes::Yes is an enum value in my case
queryBuildRange.value(tmpStr);

Thanks Thomas!

--- In development-axapta@yahoogroups.com, "Askeryd Thomas"
<[EMAIL PROTECTED]> wrote:
>
> What I got in the reply worked just fine.. except from the
>     qbdsStat.relations(true);
>     qbdsStat.joinMode(JoinMode::ExistsJoin);

> which never seems to work for me. I have to use
>     qbdsStat.addLink(FieldNum(Persons, Pnr),FieldNum(FamStatus,
Pnr));

> has anybody got a clue what that is all about...
> anyhow.. with that in mind this works just fine
>     qbrStat.value(strFmt('(((Salary > 3000) && (Persons.Age <20))
||
>                                       ((Salary < 400) &&
(Persons.Age > 50)))'));

> for ex to show that it really works. If you still cant get it to
work just give us a shout and I ll send you an xpo.
> Thomas.
>
> ________________________________
>
> Från: development-axapta@yahoogroups.com genom zekvelda
> Skickat: fr 2005-12-02 09:05
> Till: development-axapta@yahoogroups.com
> Ämne: [development-axapta] Query to 'OR' two ranges
>
>
> Hi
>
> I have a request very similiar to post number 12021
concerning 'OR'ing
> two different fields on a table in a query. I've tried the
solution
> proposed in post 12021 with no success.
>
> My scenariois as follows:
>
> I have a query on a table (MyTable). I want to return all the
records
> where 'Field1 == noyes::Yes' OR 'Field2 == noyes:Yes'. 'Field1'
> and 'Field2' are two DIFFERENT field in 'MyTable'.
>
> As was mentioned in the posts preceding post 12021, the default
method
> of creating two query ranges is an AND and I want an OR.
>
> Has anyone successfully implmented an 'OR' for a BuildQueryRange?
If
> so, can you please share your method?
>
>
>
>
>
>
>
>
>
> SPONSORED LINKS
> Computer part <http://groups.yahoo.com/gads?
t=ms&k=Computer+part&w1=Computer+part&w2=Programming+languages&w3=Mic
rosoft+axapta&w4=Support+exchange&c=4&s=90&.sig=yLpvcLTIDJ5FTkRJGsO11
w>        Programming languages <http://groups.yahoo.com/gads?
t=ms&k=Programming+languages&w1=Computer+part&w2=Programming+language
s&w3=Microsoft+axapta&w4=Support+exchange&c=4&s=90&.sig=cuhEClK4dU4wa
pXFmKisbQ>        Microsoft axapta <http://groups.yahoo.com/gads?
t=ms&k=Microsoft+axapta&w1=Computer+part&w2=Programming+languages&w3=
Microsoft+axapta&w4=Support+exchange&c=4&s=90&.sig=yfeG_U6QaLfPOZZIud
02Fg>       
> Support exchange <http://groups.yahoo.com/gads?
t=ms&k=Support+exchange&w1=Computer+part&w2=Programming+languages&w3=
Microsoft+axapta&w4=Support+exchange&c=4&s=90&.sig=hy8yRGMzrmxdphyITT
UeqA>       
>
> ________________________________
>
> YAHOO! GROUPS LINKS
>
>
>      
> *      Visit your group "development-axapta
<http://groups.yahoo.com/group/development-axapta> " on the web.
>        
> *      To unsubscribe from this group, send an email to:
>       [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]
subject=Unsubscribe>
>        
> *      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
>
>
> ________________________________
>
>
>
>
> [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




Reply via email to