MakeTable decimal places

G

Guest

I am modifying someone else's database written in Access 2000, and needing to
be kept in that version.

It has a MakeTable query that creates a field with datatype long integer. I
need to make the datatype Single with 2 decimal places.

When I open the property page for the field in query design, it does not
have a row for setting the decimal places.

When I try to alter it in SQL, it turns it back into an integer when I close
the query.

Can someone tell me how to do this?
 
J

John Vinson

I am modifying someone else's database written in Access 2000, and needing to
be kept in that version.

It has a MakeTable query that creates a field with datatype long integer. I
need to make the datatype Single with 2 decimal places.

MakeTable queries are VERY RARELY necessary. Are you *quite* certain
that you could not use a Select Query, as the basis for a form,
report, or another query?
When I open the property page for the field in query design, it does not
have a row for setting the decimal places.

When I try to alter it in SQL, it turns it back into an integer when I close
the query.

A Long Integer *is an integer* - which by definition has no decimal
places. You could (if you really insist) use an expression such as
CSngl([numericvalue]) to convert the number to a Single in your
make-table query. If it's money, or if you can do with *exactly* four
decimal places, no more no fewer, you can use a Currency datatype
instead (use CCur([numericvalue]).

John W. Vinson[MVP]
 
G

Guest

Thanks John, the CSng function worked fine.

John Vinson said:
I am modifying someone else's database written in Access 2000, and needing to
be kept in that version.

It has a MakeTable query that creates a field with datatype long integer. I
need to make the datatype Single with 2 decimal places.

MakeTable queries are VERY RARELY necessary. Are you *quite* certain
that you could not use a Select Query, as the basis for a form,
report, or another query?
When I open the property page for the field in query design, it does not
have a row for setting the decimal places.

When I try to alter it in SQL, it turns it back into an integer when I close
the query.

A Long Integer *is an integer* - which by definition has no decimal
places. You could (if you really insist) use an expression such as
CSngl([numericvalue]) to convert the number to a Single in your
make-table query. If it's money, or if you can do with *exactly* four
decimal places, no more no fewer, you can use a Currency datatype
instead (use CCur([numericvalue]).

John W. Vinson[MVP]
 

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