Truncated field length in query

  • I have a table where one of the fields has numbers that are 20 digits long. When I run a query I only get 16 digits and the rest are zeros. Not a lot of good when dealing with phone numbers!

    I have checked the Tools Options but I cannot see where I can alter this as it is set to 256 characters. Has anyone a clue what I have missed?

    Madame Artois

  • What's the table definition? What's the query?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • The column definition in the table is varchar (128). The query was a simple 'Select * where column name is 'nnnnn''. The results grid show the full number. Its only when I copy it Excel 2007 that I lose the last four digits which makes me think I must have the wrong options chosen.

    Cheers

    Madame Artois

  • S Hodkinson (4/27/2011)


    The column definition in the table is varchar (128). The query was a simple 'Select * where column name is 'nnnnn''. The results grid show the full number. Its only when I copy it Excel 2007 that I lose the last four digits which makes me think I must have the wrong options chosen.

    Cheers

    If you are pasting the number (with no spaces) into Excel then Excel with interpret it as a number, find it too large and muddles with it. Try formatting the destination cell as text before pasting.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Absolutely Brill!! It worked!

    Thanks to all!

    Madame Artois

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

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