Setting field size to double when create tableusing a make table q

N

Nina

After 4 hour of sleep last night I can't seem to remember anything .....

Thanks for your help in advance.

I am using a make table query to create empty fields for future update with
numbers (double not long integer). I would like to make the fields Double as
soon as I create the table, it defaults to long integer. I tried few things
but it does not seem to work, I remember sometime in the past I was able to
do this but it has been a while since I've had the need to do this. I
appreciate your assistance.
 
C

Clifford Bass

Hi Nina,

Use the CDbl() function:

SELECT CDbl([The_Number]) AS The_Double_Number INTO tblDouble_Numbers
FROM tblNumbers;

Clifford Bass
 
J

Jeff Boyce

Nina

A couple of common considerations ...

"Numbers" are not always numbers. For example, zip codes look like numbers
but they are just 'codes' -- you never need to add/subtract/multiple/divide
them.

"Double" allows for a large number of decimal places. If you are working
with numbers, and if they never have more than four decimal places of
precision, you can use the "Currency" data type, which is accurate to all
four places. NOTE: Double is NOT accurate all the way out -- you'll find
errors in math because Doubles are stored in binary.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John Spencer

One method to insert a blank field of type CDbl would be to use
something like the following

SELECT IIF(False,CDbl(0),Null) as MakeCDblField
, MyNameField
, MyDateField
, SomeOtherField
INTO MakeMyTable
FROM SomeExistingTable

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 

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