ARGH!! ROUNDING!! Can't get rid of trailing zeros

R

Rico

Hello,

I'm not sure if this is an SQL issue or an Access issue. I have an Access
2002 FE and I'm using a passthrough query to retrieve some information from
SQL server 2000. I am rounding in the SQL View to two decimal places, but
the passthrough is giving me numbers like 14.450000. I've tried everything
to get rid of the zeroes and convert to two decimal places, but I don't want
to write extraneous code just to conquer this problem.

Any ideas?

Thanks.
 
T

Tibor Karaszi

The values 14.450000 is the same as 14.45. Various tools present a human readable form of the binary
values that SQL Server returns based on the datatypes. this seems to be some DECIMAL(x,6) datatype,
so the tool assumes you want to see all decimals. Rounding won't change this, but converting into
some other datatype will.
 
L

Larry Linson

Rico said:
Hello,

I'm not sure if this is an SQL issue or an Access issue. I have an Access
2002 FE and I'm using a passthrough query to retrieve some information
from SQL server 2000. I am rounding in the SQL View to two decimal
places, but the passthrough is giving me numbers like 14.450000. I've
tried everything to get rid of the zeroes and convert to two decimal
places, but I don't want to write extraneous code just to conquer this
problem.

Specifying a Format for the Control in which the information is displayed
will let you limit the number of fractional digits. That would not, in my
view, qualify as "writing extraneous code just to conquer this problem"; it
would be "using the software tools as intended". Default views of various
kinds aren't always what you would like them to be.

Larry Linson
Microsoft Access 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