Total SQL newb here. I've created two SQL tables, one containing information about hotels and the other containing information about attractions.
SELECT hotels.*, attractions.*,
((ACOS(SIN(hotels.Hotel_Lat * PI() / 180) * SIN(attractions.Attraction_Lat * PI() / 180) +
COS(hotels.Hotel_Long * PI() / 180) * COS(attractions.Attraction_Long * PI() / 180) *
COS((hotels.Hotel_Long - attractions.Attraction_Long) * PI() / 180)) *
180 / PI()) * 60 * 1.1515) as distance
FROM hotels join attractions
This query returns 'Null' for distances. Any ideas why please? I have negative value longitudes if that makes a difference?