Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert into float field

Status
Not open for further replies.

solo1234

Programmer
Jun 25, 2007
39
NL
Dear all,

We have a string (float value) (komma as decimal sign) and we want this string into a floating field.

We tried:

insert into DB (floatField) values (CONVERT(DECIMAL('12,1')))
insert into DB (floatField) values (cast('12,1' as double))
insert into DB (floatField) values (cast('12,1' as decimal))

These examples doesn't work, can someone give the right syntax?

Nice regards,
Michelle.
 
Well have you tried replacing the comma with a decimal?

Also float is a very bad type of data type to use if you ever want to do calculations on the number as it is inexact and will introduce rounding issues. Perhaps you would be better served by changing the datatype to a decimal datatype.


"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top