Click to See Complete Forum and Search --> : access datatypes


esthera
08-03-2004, 06:01 AM
I have a field that stores a number. In access I made type number and fieldsize decimal. When I enter in a number (through asp) like 4.5 it automatically puts it in as a 4. What's the trick to keep the decimal part of the number?

russell
08-04-2004, 01:04 PM
you have to tell access how many decimal places. go to design view, and look at the properties.

esthera
08-05-2004, 01:36 AM
I set it to decimal with 2 places and it still automatically shows it without any decimal?

russell
08-06-2004, 03:14 AM
Lets see your code. Are you casting it in your client code? For example

clng(1.22) = 1

???

esthera
08-06-2004, 03:18 AM
problem is even in access. -- If i put in a 3.5 (and it is set as number -- decimal with one decimal place) -- I only see a 3.

russell
08-06-2004, 03:33 AM
In design view, make sure the data type is number. At the bottom, in field properties, set the field size to double.

esthera
08-06-2004, 03:37 AM
that's exactly what it is??

russell
08-06-2004, 03:47 AM
you specified double? And then set the decimal places? what version of access?

russell
08-06-2004, 03:48 AM
can you posta screen shot of your design view?

esthera
08-06-2004, 03:50 AM
whoops.. just realized I did decimal and not double.

Thanks for your help.

russell
08-06-2004, 04:18 AM
Glad to help. :)