Inserting a decimal point int a text field

S

Steis

I have a text field that I need to insert a decimal point
into. The text field values are really numbers that I need
to input a decimal point into. I tried table design on
that field and put in a format and/or input mask but I
can't get it to come out right. Ex value is 3485 and I
need it to be stored as 348.5 Thanks!
 
T

Tim Ferguson

Ex value is 3485 and I
need it to be stored as 348.5

UPDATE MyTable
SET NewTextField = Left(OldTextField,3) & "." & Right(OldTextField,1)
WHERE Len(OldTextField)=4

or, an alternative

UPDATE MyTable
SET NewTextField = Format(CDbl(OldTextField)/10,"000.0")
WHERE IsNumeric(OldTextField)

(I'm not too sure about the IsNumeric function -- you may have to
experiment a bit there.. )


Hope that helps

Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top