Logo 
Search:

SQL Forum

Ask Question   UnAnswered
Home » Forum » SQL       RSS Feeds

Distance calculation

  Asked By: Ravi    Date: Jan 08    Category: SQL    Views: 780
  

Hi All,

I need one help:

I have table with columns like (Name, Lat1, Long1, Lat2, Long2, Distance). I need the query for distance between (Lat2, Long2) and (Lat1, Long1) update in Distance colum. I know excel function what I am using in excel (=ACOS(COS(RADIANS(90-[@Lat1])) *COS(RADIANS(90-[@Lat2])) +SIN(RADIANS(90-[@Lat1])) *SIN(RADIANS(90-[@Lat2])) *COS(RADIANS([@Long1]-[@Long2]))) *6371).

If any one help me that great...

Share: 



Tagged: