Filter

sharon95
Member Posts: 183
I have to filter a table with the Vehicle Number that is repeated more than once... How can I do it? Thanks!
0
Answers
-
you can use setrange on vehicle no. and check whether count is more than 1.
is that what you need?0 -
for a report0
-
Hi sharon95,
you certainly do know this by now, don't you?RESET; SETRANGE("Vehicle Number",MyNumber); IF FINDSET THEN REPEAT ; // do what you need to do UNTIL NEXT = 0;
0 -
Hi sharon95,
you certainly do know this by now, don't you?RESET; SETRANGE("Vehicle Number",MyNumber); IF FINDSET THEN REPEAT ; // do what you need to do UNTIL NEXT = 0;
yes but, I'm doing this in a report and MyNumber is not fixed, but I have to count all vehicle numbers in the table0 -
mohana_cse06 wrote: »you can use setrange on vehicle no. and check whether count is more than 1.
is that what you need?
no, I'm in a report and I have to filter the records which have the vehicle number repeated more than once0 -
So You have report with vehicles. but some vehicles (in table) have the same number.
You want to know all vehicles that have not unique numbers.
Add Record variable to report
for example VehicleCount = record from table Vehicles
in report trigger OnAfterGetRecord (DataItem=Vehicles)
write a code
VehicleCount.SETRANGE("Vehicle Number","Vehicle Number");
IF VehicleCount.COUNT=1 THEN CurrReport.SKIP;
so report will skip all vehicles that have unique number.
0 -
If you want to count all vehicle numbers then you can write this
T.RESET;
T.SETRANGE("Vehicle Number",MyNumber);
IF T.FINDSET THEN
IF T.COUNT > 1 THEN
TotalVehicleNo := T.Vehicle Number";
Here you will find only those vehicle number whose count is > 1 means which is repeated.
Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0 -
So You have report with vehicles. but some vehicles (in table) have the same number.
You want to know all vehicles that have not unique numbers.
Add Record variable to report
for example VehicleCount = record from table Vehicles
in report trigger OnAfterGetRecord (DataItem=Vehicles)
write a code
VehicleCount.SETRANGE("Vehicle Number","Vehicle Number");
IF VehicleCount.COUNT=1 THEN CurrReport.SKIP;
so report will skip all vehicles that have unique number.
what is "VehicleCount record from table Vehicles", a global variable for the table? thanks!0 -
So You have report with vehicles. but some vehicles (in table) have the same number.
You want to know all vehicles that have not unique numbers.
Add Record variable to report
for example VehicleCount = record from table Vehicles
in report trigger OnAfterGetRecord (DataItem=Vehicles)
write a code
VehicleCount.SETRANGE("Vehicle Number","Vehicle Number");
IF VehicleCount.COUNT=1 THEN CurrReport.SKIP;
so report will skip all vehicles that have unique number.
what is "VehicleCount record from table Vehicles", a global variable for the table? thanks!
Yes0 -
a global variable for the table?
>>>>>>>>>>>>>>>>>>>>
Global varaible of Report !0
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