change data type from decimal to double

  • Thread starter Thread starter Bongard
  • Start date Start date
B

Bongard

I have a linked table in which I can't change the data types and the
amount field is a decimal data type. From that table I combine some
other fields from other tables with a make table query. Ultimately I
run a crosstab that gives me the message (Decimal data type doesn't
have enough precision) or something like that. I can then go manually
into my make table and change the data type to double everytime I run
it but I would like this to happen automatically. Could I change the
data type from decimal-double using an append or an update query
somehow?

Thanks for your help!
Brian
 
Brian

If you are using a "make table" each time you do this, consider doing the
following instead:

Create the new table once. Modify the data types as needed.

Now, every time you would have used "Make Table", instead first delete all
the records from that table, then append all the new records, doing any data
type conversion needed.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Bongard said:
I have a linked table in which I can't change the data types and the
amount field is a decimal data type. From that table I combine some
other fields from other tables with a make table query. Ultimately I
run a crosstab that gives me the message (Decimal data type doesn't
have enough precision) or something like that. I can then go manually
into my make table and change the data type to double everytime I run
it but I would like this to happen automatically. Could I change the
data type from decimal-double using an append or an update query
somehow?


Just use the CDbl function in your make table query.
Something along these lines:

INSERT INTO sometable
SELECT f1, f2, CDbl(decimalfield)
FROM linkedtable
 
Back
Top