Re: Calculate distance between two points (numbers) in a number line
- From: "Tom Lake" <toml_12953@xxxxxxxxxxx>
- Date: Mon, 22 Jun 2009 11:26:50 -0400
"Silvio" <Silvio@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:FD4D7C6F-8910-493C-9F32-DE2B74B37DB1@xxxxxxxxxxxxxxxx
Hello everyone, how can I calculate the distance between two points (numbers)
in a number line using a calculated field? For example: (Filed1 and Filed are
saved number in any combination of positive and negative numbers)
Filed1 = -10
Field2 = +15
Number distance = 25 (this is the correct result)
Example 2:
Filed1 = -10
Field2 = -5
Distance = 5 (this is the correct result)
Example 3:
Filed1 = -10
Field2 = 5
Distance = 15 (this is the correct result)
This is what I have done but it does not work with combination of negative
and positive numbers...
=(IIf(([Filed1]>[Filed2]),Abs([Filed1])-Abs([Filed2]),([Filed2]-[Filed1])))
Why not just do
=Abs([Filed1] - [Filed2])
(did you mean Field1 and Field2?)
Tom Lake
.
- Follow-Ups:
- References:
- Prev by Date: Re: Filter a list containing null values
- Next by Date: Re: Calculate distance between two points (numbers) in a number li
- Previous by thread: Calculate distance between two points (numbers) in a number line
- Next by thread: Re: Calculate distance between two points (numbers) in a number li
- Index(es):
Relevant Pages
|