I have the sql queries like this:
Select Userid, sum(cast(distanceinKM as int)) as KM, day from(
SELECT [User].Userid
,[User].ulatitude, [User].ulongitude, [Checkpoint].clatitude, [Checkpoint].clongitutde,
(geography::Point([User].ulatitude, [User].ulongitude, 4326)).STDistance
(geography::Point([Checkpoint].clatitude, [Checkpoint].clongitutde, 4326))/100 as distanceinKM, cast(Timestamp as date) as day
FROM [User] INNER JOIN
Tablelog ON [User].Userid = Tablelog.Userid INNER JOIN
[Checkpoint] ON Tablelog.checkpointid = [Checkpoint].checkpiontid ) as distance
where Day(day) = 6 AND MONTH (day) = 9 AND YEAR (day) = 2011
group by userid , day
The function works well, but I have a problem with the coordinates. In my database my coordinates are stores this way: (55.56490549999999, 9.756640400000038)
but in the query I have them divided into ulatitude and ulongtitude. So I was dividing them manually but I cannot do that anymore since I have a lot of data.
What can I add in the query so I take the coordinates in this format (55.56490549999999, 9.756640400000038)
and divide them .