getting values tied to a max and min calculation
am 31.10.2007 18:19:15 von EPHello all,
I have a database with a table called Line and a table called Points.
A line has many points, and a point can be a part of many lines. I
have an intermdiate table called Points.Lines to clear up the many to
many relationship.
Anyways, in the Points.Lines table, I have a field called Order_Num
that lets a user choose which order on the line he or she wants to
view the points in a portal.
In the Line table, I have it set to monitor what is the lowest
Order_Num on the Points.Lines table and what is the highest one using
the min and max calculations. If a line has 3 points, these would be
1 and 3, respectively.
What I am having trouble doing is this:
In the Lines table, I want to have two fields called Start_point and
End_point. This will be automatically calculated based on what the
highest and lowest values are in the Points.Lines table. Now I can
get the highest and lowest values (1 and 3), but how can I set the
calculation to tell me what point_id is tied to these positions?
I want it to say "Ok, the lowest value is 1. What point belongs to
this 1?" and the same for the highest number. I want the field to
display which point has that value.
I would like to think this is an easy calculation (I would like to
keep it scriptless). However I've been pulling my hair out on this.
Any suggestions?