GPS format in sql table

  • I want to add zeroes for all the gps coordinates i have which end with a single number after the decimal point for ex: i have N 24 34.124,E 46 38 25.3 i want N 24 34.124,E 46 38 25.300.

    Can anyone help me plaese...........

    Its urgent????

  • That's a formatting issue, not a data storage issue. You should deal with that on the client side, not in your database.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • store the latitude and longitude in decimal form only.

    it's trivial to convert the decimal to the long syntax, but very difficult to do it back from text to decimal...lots of parsing is required.

    for example, Decimal Degrees = Degrees + minutes/60 + seconds/3600

    so (24 34.124,46 38 25.3) should be stored as (24.56873333333333,46.64036111111111); then you can display it any way you want, but it's much eisier to calculate when you need something withing 10 miles/kilometers of a point or not.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply