ciao a tutti ho questa selec che ha sempre funzionato però ora in questo caso non funziona ecco la select:

Codice PHP:
h_sqlpunti_i "select *, TRUNCATE ( 6363 * sqrt( POW( RADIANS("&lat_luogo&") - RADIANS(lat) , 2 ) + POW( RADIANS("&long_luogo&") - RADIANS(long) , 2 ) ) , 3 ) AS distance_pt from province where lat is not null and long is not null and TRUNCATE ( 6363 * sqrt( POW( RADIANS("&lat_luogo&") - RADIANS(lat) , 2 ) + POW( RADIANS("&long_luogo&") - RADIANS(long) , 2 ) ) , 3 ) < "&kmd&"+10 ORDER BY distance_pt ASC" 
errore:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-4.1.9-max]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'long) , 2 ) ) , 3 ) AS distance_pt from province where lat is not null and long ' at line 1
/include/menusx_inc.asp, line 912


Stampa della select:

Codice PHP:
select *, TRUNCATE 6363 sqrtPOWRADIANS(43.7687324) - RADIANS(lat) , ) + POWRADIANS(11.2569013) - RADIANS(long) , ) ) , ) AS distance_pt from province where lat is not null and long is not null and TRUNCATE 6363 sqrtPOWRADIANS(43.7687324) - RADIANS(lat) , ) + POWRADIANS(11.2569013) - RADIANS(long) , ) ) , ) < 30+10 ORDER BY distance_pt ASC 
avete qualche idea? I campi lat e long sono campi varchar(100) ...

la stessa select con un altra tabella funziona .. non riesco a capire