Hi all,
I’m working in Nav 5.0 Sp1 (native).
We always use SETFILTER or SETRANGE to filter actual data we want. But if we can’t find
the actual data than how can we get the set of approximately same data.
Scenario
I just want to filter the Set of data 99…100
Asking value is 99.99
Table Data
99
100
120
Now or Never
0
Comments
SETFILTER(MyField,'%1..%2',90,100) :?: :?:
I haven't seen to many cases of where you would need to approximate something like that. Is there a specific requirement that you're trying to meet?
Epimatic Corp.
http://www.epimatic.com
Dear kapamarou,
Thanks for your quick reply.
This is hard coding.
My Scenario is an example :-$
I think I have to write extra code for the goal.
I agree with jlandeen. =;
Thanks for your reply.
DECField
90,00
91,00
94,00
95,50
98,00
98,50
99,00
99,56
99,60
99,87
99,98
106,00
120,00
returns 99,98 because 99,99 is not found and 100 doesn't exist (in this example)
Regards
How About this?
MyRec.SETRANGE(MyField,TargetValue,TargetValue);
IF MyRec.ISEMPTY THEN
MyRec.SETRANGE(MyField,MyValue * (1 - MyTolerance / 100),MyValue * (1 + MyTolerance / 100) )
Keep MyTolerance in a setup table and you can use it. you could also put this code in a loop and increase your range until you find records. It does require some code but I think it could help...
Thnx garak;
SETRANGE (decField, 99.99);
IF find(‘-‘) THEN
begin
Abc…;
Xyz…;
End
Else
begin
Setfilter(decField,’<%1’,99.99);
IF findfirst then
Var1;
Setfilter(decField,’>%1’,99.99);
IF findfirst then
Var2;
Setfilter(decField, Var1, Var2);
If find(‘-‘) then
Abc;
Xyz;
End;