Hi!

An example from CustTable:
((Name == "Velofix AG") || (InvoiceAccount == "4008")).
You can use each field in the Query for e.g. Recid.


In the code you can do this:

public void init()
{
    Range range;
    QueryBuildRange qbr;
    custaccount account = '4008';
    name        name    =  'Velofix AG';
    ;
    super();


    qbr =
this.query().datasourcetable(tablenum(custTable)).addrange(fieldnum(custtable,
recid));

    range   = strfmt('((%1 == \"%2\") || (%3 ==
\"%4\"))',fieldstr(CustTable,Name),name,fieldstr(CustTable,InvoiceAccount),account);

    qbr.value(range);


}



Regards Michael


>From: Bj�rn Gudbrand Idstad <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: <[EMAIL PROTECTED]>
>Subject: [development-axapta] Query logic OR
>Date: Fri, 16 Apr 2004 15:25:03 +0200
>
>Hi!
>
>Is it possible to create a Query in Axapta, that fetches all records from a
>table, where the value in field one is "xxx" or the value of field two is
>"yyy".
>
>E.g I want to get all records from SmmBusRelTable where field "Firma"
>matches "2142917" OR where "ABC-kode" matches "A".
>
>
>
>
>
>Regards Bj�rn

_________________________________________________________________
MSN Messenger - sehen, welche Freunde online sind!
http://www.msn.de/messenger Jetzt kostenlos downloaden und mitmachen!



Yahoo! Groups Links

Reply via email to