It looks like you're new here. Sign in or register to get started.
RESET; SETRANGE("Vehicle Number",MyNumber); IF FINDSET THEN REPEAT ; // do what you need to do UNTIL NEXT = 0;
vaprog wrote: » 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;
mohana_cse06 wrote: » you can use setrange on vehicle no. and check whether count is more than 1. is that what you need?
muca wrote: » 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.
sharon95 wrote: » muca wrote: » 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!
Answers
is that what you need?
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
you certainly do know this by now, don't you?
yes but, I'm doing this in a report and MyNumber is not fixed, but I have to count all vehicle numbers in the table
no, I'm in a report and I have to filter the records which have the vehicle number repeated more than once
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.
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.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
what is "VehicleCount record from table Vehicles", a global variable for the table? thanks!
Yes
>>>>>>>>>>>>>>>>>>>>
Global varaible of Report !