Results 1 to 5 of 5

Thread: Table Settings

  1. #1
    Join Date
    Oct 2009
    Posts
    3

    Unanswered: Table Settings

    I have a table that contains numbers and I changed the type from VARCHAR to Float 7,2 which changed the display of the column to include a decimal point and 2 decimal places. The problem is that the column contains numbers that have 4 numbers plus 2 decimal places and the display will only show 999.99 and it won't change, even if I go back and change it back to VARCHAR.

    What has happened to effect this, and what do I have to do to fix it, short of deleting the table and starting over again.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    run your query directly in mysql, i bet it's actually working

    but anyhow, it might be easier to start over and reload into a new table with DECIMAL(7,2) instead of FLOAT(7,2)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Oct 2009
    Posts
    3

    Table Settings

    As the column does not automatically total, I entered the correct amounts and it does show the xxxx.00 amounts. I will probably take your suggestion and re-load using DECIMAL rather than FLOAT.

    I came across another issue, when I run an sql query asking to display the records, using order total DESC, it does not list them in order. This is what it shows.

    996.00
    990.00
    90.00
    889.00
    836.00
    350.00
    35.00
    3257.00
    325.00

    Here is the query I am using

    select * from table order by total DESC;

    Why is it not displaying correclty.

  4. #4
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    they are in order for character data.

  5. #5
    Join Date
    Oct 2009
    Posts
    3

    Table Settings

    Got it figured out, thanks everyone for your help.

Posting Permissions

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