T
Tom
I need some help with finding the "nearest" value and add TRUE/FALSE into an
expression field.
This is the data as pulled from the query:
==========================
ID Amount
1 100
2 99
3 510
4 450
5 21
6 1000
7 375
9 395
I want to find the "Amount" that is nearest to "475".
The "direction" can be either "above" or "below" 475. In this case, "450"
is TRUE (below amount).
This is the data as I want to see it when qry is executed:
====================================
ID Amount Expression
1 100 False
2 99 False
3 510 False
4 450 True
5 21 False
6 1000 False
7 375 False
9 395 False
If the number to be found was "490", I would expect "510" to be TRUE (and
450 to be FALSE).
Does anyone know how to do that?
Thanks,
Tom
P.S. As shown above, the records are sorted by ID
expression field.
This is the data as pulled from the query:
==========================
ID Amount
1 100
2 99
3 510
4 450
5 21
6 1000
7 375
9 395
I want to find the "Amount" that is nearest to "475".
The "direction" can be either "above" or "below" 475. In this case, "450"
is TRUE (below amount).
This is the data as I want to see it when qry is executed:
====================================
ID Amount Expression
1 100 False
2 99 False
3 510 False
4 450 True
5 21 False
6 1000 False
7 375 False
9 395 False
If the number to be found was "490", I would expect "510" to be TRUE (and
450 to be FALSE).
Does anyone know how to do that?
Thanks,
Tom
P.S. As shown above, the records are sorted by ID