Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Location
    NJ USA
    Posts
    19

    Unanswered: Remove padded Zero after converting Real to Carchar.

    Hello All,

    I am facing problem to get exacltly value using convert function. Please follow below steps.

    Crete table A (ID Real)

    Insert into A values(0.000013)

    select * from a

    Ouput
    -------------------
    1.13 e05

    But I want '0.000013' to display so that is why I have written below Query.

    select convert(varchar, convert(DECIMAL(30,6), id)) from A

    ----------------
    0.00001300

    I am getting '0.001300' values because scale is 6 in Decimal so that is why I am getting but want to get '0.0013' values. Please let me know

    ---- Is any function using that I can remove added/padded zero suffix.

    Current Expected result.
    0.00001300 to 0.000013


    __________________
    M. Jain
    M. Jain

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I thought I posted this

    Guess not

    Code:
    USE Northwind
    GO
    
    CREATE TABLE A ([ID] Real)
    GO
    
    INSERT INTO A ([ID]) values(0.001300)
    
    SELECT CONVERT(varchar(45), [ID]) FROM A
    GO
    DROP TABLE A
    GO
    Plus this is a cross post...

    HEY NJ

    What Exit?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •