Verbat Posted January 19, 2008 Share Posted January 19, 2008 I need 1 of the fields in the table to save numbers in it, and it includes all kind of numbers like 100, 0.22, 5.67 and so on. Now when i sort this field it shows the 5.67 first then the 100 and then the 0.22. I tryed to change the Type of the field to INT but then it removes everything after the . so it shows me 100, 0, 5. How can i solve this? Thanks Link to comment https://forums.phpfreaks.com/topic/86747-solved-sql-table-problem/ Share on other sites More sharing options...
beansandsausages Posted January 19, 2008 Share Posted January 19, 2008 tyr using decimal for the value Link to comment https://forums.phpfreaks.com/topic/86747-solved-sql-table-problem/#findComment-443346 Share on other sites More sharing options...
Verbat Posted January 19, 2008 Author Share Posted January 19, 2008 tyr using decimal for the value When i make it decimal then it removes everything after the . aswell. Link to comment https://forums.phpfreaks.com/topic/86747-solved-sql-table-problem/#findComment-443348 Share on other sites More sharing options...
beansandsausages Posted January 19, 2008 Share Posted January 19, 2008 i know i will get told off here but see if it works with varchar i know its not fir numbers. Link to comment https://forums.phpfreaks.com/topic/86747-solved-sql-table-problem/#findComment-443350 Share on other sites More sharing options...
Verbat Posted January 19, 2008 Author Share Posted January 19, 2008 i know i will get told off here but see if it works with varchar i know its not fir numbers. No it doesnt work with Varchar but i fixed it All you have to do is use DECIMAL for the Type and Change the Length/Values to 10,2 the number after the , means number of numbers after the . Link to comment https://forums.phpfreaks.com/topic/86747-solved-sql-table-problem/#findComment-443352 Share on other sites More sharing options...
beansandsausages Posted January 19, 2008 Share Posted January 19, 2008 missed edit time, select decimal where says Length/Values* types 100,5 that will make the 1st number max of 100 numbees long and number after the . 5 numbers long EDIT : must of posted at same time Link to comment https://forums.phpfreaks.com/topic/86747-solved-sql-table-problem/#findComment-443353 Share on other sites More sharing options...
Verbat Posted January 19, 2008 Author Share Posted January 19, 2008 missed edit time, select decimal where says Length/Values* types 100,5 that will make the 1st number max of 100 numbees long and number after the . 5 numbers long EDIT : must of posted at same time Thanks man. Link to comment https://forums.phpfreaks.com/topic/86747-solved-sql-table-problem/#findComment-443355 Share on other sites More sharing options...
beansandsausages Posted January 19, 2008 Share Posted January 19, 2008 Np Link to comment https://forums.phpfreaks.com/topic/86747-solved-sql-table-problem/#findComment-443357 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.