from comp.graphics.algorithms: if your polyline goes from A to B and your point is P, you can use this formula: v = (Ay-By)*Px+(Bx-Ax)*Py+(Ax*By-Bx*Ay) v>0: "Left" v<0: "Right" v=0: "On the line" (or in front of B / behind A) using this and x(),y(), startpoint(), and endpoint() functions you can do it in your SQL statement i think. -Eric