I'm attempting to convert an application from ASP/Access to PHP/MySQL  My
problem is in the SQL conversion.

The SQL determines distance between two zip codes:

This is the Access original:

SELECT Dealers.*, ((2285-Zips.North)^2+(4760-Zips.West)^2)^.5 AS Distance
FROM Dealers INNER JOIN Zips ON Dealers.Zip = Zips.Zip ORDER BY
(2285-Zips.North)^2+(4760-Zips.West)^2

The numbers in the calculations (such as the 2285 and 4760) are brought in
from the Zips table prior to this piece of SQL being sent.  I've tried a
number of things (breaking it down into smaller chunks, changing ON to
USING, etc.) but don't seem to be able to make the calculation work in the
SQL.

Any help here?  Please reply to me since I only *subscribe* to the Win32
MySQL list.

Thanks, John




---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to