[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

Query with different field

Peter CCH

1/11/2006 10:53:00 AM

If I would like to use Query object to achieve result that will be the same
as the following, how should I code it? Is that possible with Query object?

select _custInvoiceJour
where _custInvoiceJour.RefNum != RefNum::SalesOrder &&
_custInvoiceJour.SalesType == SalesType::Journal

Thanks.

2 Answers

Peter CCH

1/11/2006 12:00:00 PM

0

Sorry, it suppose to be OR condition, not AND.

select _custInvoiceJour
where _custInvoiceJour.RefNum != RefNum::SalesOrder ||
_custInvoiceJour.SalesType == SalesType::Journal


"Peter CCH" wrote:

> If I would like to use Query object to achieve result that will be the same
> as the following, how should I code it? Is that possible with Query object?
>
> select _custInvoiceJour
> where _custInvoiceJour.RefNum != RefNum::SalesOrder &&
> _custInvoiceJour.SalesType == SalesType::Journal
>
> Thanks.
>

Mathias

1/11/2006 12:23:00 PM

0

Am Wed, 11 Jan 2006 04:00:13 -0800 schrieb Peter CCH:

> Sorry, it suppose to be OR condition, not AND.
>
> select _custInvoiceJour
> where _custInvoiceJour.RefNum != RefNum::SalesOrder ||
> _custInvoiceJour.SalesType == SalesType::Journal
>
>
> "Peter CCH" wrote:
>
>> If I would like to use Query object to achieve result that will be the same
>> as the following, how should I code it? Is that possible with Query object?
>>
>> select _custInvoiceJour
>> where _custInvoiceJour.RefNum != RefNum::SalesOrder &&
>> _custInvoiceJour.SalesType == SalesType::Journal
>>
>> Thanks.
>>

Hello Peter,

you can try this:

QueryBuildRange myRange =
myQuery.datasourceName("DataSource").addRange(fieldnum(Table, Recid));

myRange.value(strfmt('((%1 <= %2) || (%3 >= %4))',
fieldStr(custInvoiceJour, RefNum), queryvalue(RefNum::SalesOrder),
fieldStr(custInvoiceJour, alesType),
queryvalue(SalesType::Journal)));

you can check axaptapedia
(http://www.axaptapedia.com/index.php/Expressions_in_qu...) for
further information.