Filter table using data from another filtered table

haihth
Member Posts: 32
Hi all members of Mibuso !
I'm creating report and have a problem.
How can i set a filter with table1 like SQL that:
select * from table1
where table1."document no" in (select documentno from table2 where table2.documentno like '%abc' and table2.date>'02/02/02')
I have a solution with item data:
table2 ( with filter on documentno and date)
--table1 ( with datalink documentno=documentno)
but i can not group data in table1 because table1 run step by step with document no of table2.
who can help me, thanks very much.
I'm creating report and have a problem.
How can i set a filter with table1 like SQL that:
select * from table1
where table1."document no" in (select documentno from table2 where table2.documentno like '%abc' and table2.date>'02/02/02')
I have a solution with item data:
table2 ( with filter on documentno and date)
--table1 ( with datalink documentno=documentno)
but i can not group data in table1 because table1 run step by step with document no of table2.
who can help me, thanks very much.
0
Comments
-
Make your report on table1 with the correct sorting for your grouping, and in the OnAfterGetRecord trigger check table2 en SKIP if the link isn't correct.0
-
MBerger wrote:Make your report on table1 with the correct sorting for your grouping, and in the OnAfterGetRecord trigger check table2 en SKIP if the link isn't correct.
I already did:
table1 - OnAfterGetRecord()
table2.SETCURRENTKEY("documentno");
table2.SETFILTER(table2.documentno,'*abc');
table2.SETFILTER(table2.date,'080207');
IF table2.FIND('-') THEN
REPEAT
IF NOT table2.GET(table1.documentno) THEN
CurrReport.SKIP;
UNTIL table2.NEXT=0;
But it isn't working.
Any idea for me?
Thanks0 -
haihth what are you trying to do?
Forget the code and focus on the business need. Once you can describe the business requirement, the code will be a simple issue to resolve, but right now it seems you are not sure of the final objective.David Singleton0
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