If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Table Settings

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-08-09, 12:56
afoster afoster is offline
Registered User
 
Join Date: Oct 2009
Posts: 3
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.
Reply With Quote
  #2 (permalink)  
Old 10-08-09, 15:27
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 10-08-09, 16:08
afoster afoster is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 10-08-09, 16:16
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
they are in order for character data.
Reply With Quote
  #5 (permalink)  
Old 10-08-09, 20:54
afoster afoster is offline
Registered User
 
Join Date: Oct 2009
Posts: 3
Table Settings

Got it figured out, thanks everyone for your help.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On