Use OR operator to filter 2 columns with the same value?

nxbang
Member Posts: 11
Hi all,
I have a situation is adding 2 ranges to the QueryBuildDataSource to filter 2 difference columns with the same value, similar to the query string as below:
select tableName where column1 == "A" || columns == "A";
Could you show me how to implement that by Query, QueryBuildDataSoure object, please?
Thanks.
I have a situation is adding 2 ranges to the QueryBuildDataSource to filter 2 difference columns with the same value, similar to the query string as below:
select tableName where column1 == "A" || columns == "A";
Could you show me how to implement that by Query, QueryBuildDataSoure object, please?
Thanks.
______________________________________
Dont think flowers is droped when the spring pass
Dont think flowers is droped when the spring pass
0
Comments
-
nxbang wrote:
Could you show me how to implement that by Query, QueryBuildDataSoure object, please?
Thanks.
The first question is: do you know how to build such query using QueryBuildDataSource etc. ?
If you do, so I can tell you some hint. You can use a string which be a queryExpression. You can put there a phrase of SQL and put it do your query as queryvalye. An example is in Address form in addQuerySmmQuotationTable method
If you still don't know how to do this, please let me know, I'll try to do some ready-to use exampleI have a question0 -
Dear s0843,
I already finished that one. Thank you anyway...s0843 wrote:The first question is: do you know how to build such query using QueryBuildDataSource etc. ?
If you do, so I can tell you some hint. You can use a string which be a queryExpression. You can put there a phrase of SQL and put it do your query as queryvalye. An example is in Address form in addQuerySmmQuotationTable method
If you still don't know how to do this, please let me know, I'll try to do some ready-to use example______________________________________
Dont think flowers is droped when the spring pass0 -
Hello!
You can try this following code in a Job:-
SalesTable SalesTable;
Query Q;
QueryRun QR;
Str QueryString;
;
QueryString = '(CustAccount="4010") || (InvoiceAccount ="4010")';
Q = new Query();
//In addrange() you can add any fields from SalesTable
Q.addDataSource(Tablenum(SalesTable)).addRange(Fieldnum(SalesTable,CustAccount)).value(QueryString);
QR = new QueryRun(Q);
while(QR.next())
{
SalesTable = QR.getNo(1);
Print SalesTable.SalesId;
Pause;
}
Regards,
Chacko Thomas0 -
You may also consider this article - it describes extessivelly query range problem in Axapta http://www.axaptapedia.com/index.php/Ex ... ery_rangesKind regards,
Ciprian Dudau
Axapta Developer0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions