On 9 Oct 2006 12:04:54 -0700, "el********@o2.pl" <el********@o2.pl>
wrote:
>to clarify:
I usually export huge amount of data from our accounting system (300K
being small sample). While importing txt file into access I receive all
the 3 columns in text format. What I was thinking is that ...in order
to do any computation I need to convert revenue text format into number
format ... hence my question. What I just discovered is
1) MS access will perform 4 basic mathematical operation (*, /, -, +)
on text data (numbers) .. returning results in number format !!!
Basically what I need to do is to multiply any non number format text
by 1 and I will receive a column with number data (providing it is
really number )...which I do not really need considering #1 ;-) ...it
is all teamwork ... !!
I think I understand you a bit better. From what you said, I would
imagine a single record you have something like this after importing
to MS Access. Let's call your table tblTransactions.
[TextField1] [TextField2] [TextField3]
"Line Item A" "33" "Other text"
"Line Item B" "104" "Blah Blah"
"Line Item C" "250" "Blah Blah"
....
If this is true, you could reference table fields containing
text-string representations of numbers as if they were numbers
using CInt, CLng, CCur - to name a few. For example,
SELECT CCur([TextField2])+12 AS CalcField,
tblTransactions.TextField1FROM tblTransactions;
would allow you to list your first 2 table fields, adding 12 to the
value expressed in the 2nd field and displaying it as currency.
I'm of the opinion that, although multiplying the number 1 times
the string "33" may produce the numerical result you seek, it
only does so as the result of MS Access coercing the string
value to 33 to a numeric value because it 'assumes' that's what
you want to do. Its probably not always in your best interest to
let someone on the Access Development Team make your
decisions for you like that. I say this in spite of the fact that
what you tried worked.