By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,493 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

converting string to number without rounding decimals

P: n/a
RC
I am getting input from a digital scale and if the weight on the scale
is 9.25 pounds, the input looks like:
009.25LB I need to remove the LB and the leading zeros and have the
remaining value as a number (not a text string). The best solution I
came up with was to use the Left and Right functions to clean up the
string so that it becomes 009.25 BUT it is still a string. I can use
the CCur function to convert it to currency and it looks like 9.25 but
I need to convert Pounds to Kilograms at a later point so the
"currency" may not convert properly.
ALSO, I am plugging the data into a Linked table and I don't know how
to change the linked table field to Currency (if I wanted to do this).
Do I need to unlink the table somehow, then change it and then
re-link the tabel?

Thanks in advance for any help with this. RC
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Leave it as text in your table and used a query based on the table for calcs
etc.

Use a calculated field in the query:

CDbl(Left([Field],Len([Field])-2))

--
Michael Hopwood
"RC" <rc*********@yahoo.com> wrote in message
news:3c**************************@posting.google.c om...
I am getting input from a digital scale and if the weight on the scale
is 9.25 pounds, the input looks like:
009.25LB I need to remove the LB and the leading zeros and have the
remaining value as a number (not a text string). The best solution I
came up with was to use the Left and Right functions to clean up the
string so that it becomes 009.25 BUT it is still a string. I can use
the CCur function to convert it to currency and it looks like 9.25 but
I need to convert Pounds to Kilograms at a later point so the
"currency" may not convert properly.
ALSO, I am plugging the data into a Linked table and I don't know how
to change the linked table field to Currency (if I wanted to do this).
Do I need to unlink the table somehow, then change it and then
re-link the tabel?

Thanks in advance for any help with this. RC

Nov 13 '05 #2

P: n/a
On 30 May 2004 08:46:54 -0700, RC wrote:
I am getting input from a digital scale and if the weight on the scale
is 9.25 pounds, the input looks like:
009.25LB I need to remove the LB and the leading zeros and have the
remaining value as a number (not a text string). The best solution I
came up with was to use the Left and Right functions to clean up the
string so that it becomes 009.25 BUT it is still a string. I can use
the CCur function to convert it to currency and it looks like 9.25 but
I need to convert Pounds to Kilograms at a later point so the
"currency" may not convert properly.
ALSO, I am plugging the data into a Linked table and I don't know how
to change the linked table field to Currency (if I wanted to do this).
Do I need to unlink the table somehow, then change it and then
re-link the tabel?

Thanks in advance for any help with this. RC


How about
=Val(YourField])

"0009.25LB" as Text becomes 9.25 (a number)
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.