MySQL Forums
Forum List  »  Newbie

Type-Question
Posted by: Dermy sqlheld
Date: June 14, 2005 05:31PM

Hi all,

I have a table which looks like that:

CREATE TABLE `rr_radtour_tabelle` (
`fahrer` varchar(50) NOT NULL default '',
`strecke` dec(5,2) NOT NULL default '',
`gebrauchte_zeit` varchar(10) default NULL,
`bemerkung` varchar(255) default NULL,
`akt_gewicht` dec(5,2) NOT NULL default '',
`akt_groesse` dec(5,2) NOT NULL default '',
`akt_alter` int(10) NOT NULL default '',
`datum` varchar(255) NOT NULL default '',
`datum_eintrag` varchar(255) NOT NULL default '',
PRIMARY KEY (`fahrer`)
) type=MyISAM;

After a user entered his data in a formular, maybe strecke = 35,82, the value of strecke is set to 35.00
What am i doing wrong here? I thought dec(5,2) means, that numbers like 12345,12 are possible, but why is the part after the comma set to .00 ?!
A more generell question: How do i know, which types i need? If i want to make some calculations with values, can i take varchar for that or wont that work?

Many thanks in advance for replies,
Regards. Dermy.

Options: ReplyQuote


Subject
Written By
Posted
Type-Question
June 14, 2005 05:31PM
June 15, 2005 12:52AM
June 15, 2005 08:40AM
June 16, 2005 02:11AM
June 17, 2005 08:21AM
June 17, 2005 12:21PM
June 17, 2005 04:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.