latitude / longitude Rule

  • Hi

    I am having an int column of length 8..

    i have to convert it to Latitude/ longitude value bye using rule-

    divide by 10 to the power 6..

    but as i do this the scale digits become 000000..

    i dont wanna lose them just wana cast the actual value to decimal(8,6)

    any help is appreciated

    thanks

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

  • SQL Learner-684602 (11/10/2009)


    Hi

    I am having an int column of length 8..

    i have to convert it to Latitude/ longitude value bye using rule-

    divide by 10 to the power 6..

    but as i do this the scale digits become 000000..

    i dont wanna lose them just wana cast the actual value to decimal(8,6)

    any help is appreciated

    thanks

    Please show us your code. But before doing that, try this: (YourColumn * 1.0) in place of just YourColumn.

  • i have to cast a column like this

    select cast(73982597/1000000 as numeric(8,6))

    it gives me 73.000000

    but i want result as 73.982597

    any help

    thanks

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

  • SQL Learner-684602 (11/10/2009)


    i have to cast a column like this

    select cast(73982597/1000000 as numeric(8,6))

    it gives me 73.000000

    but i want result as 73.982597

    any help

    thanks

    Integer arthimetic. Do this:

    select cast(73982597/1000000.0 as numeric(8,6))

  • thnk u thnk thnku:-)

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

Viewing 5 posts - 1 through 4 (of 4 total)

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