ROUND still doesn't work.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My previous post did not generate a solution, so here I go again. The
following SQL produces a column with 12 decimal places:

SELECT ROUND([UFS 1] / AVERAGE_COST, 1) AS [UF 1]
FROM dbo.View_Underforecast_111

Why isn't it rounding?

I tried putting a form on top of it and setting the format to show 1 decimal
place, but the result is the same!

(This project is an Access 2000-format ADP under Office 2003.)

Thanks!
 
Hi

Can you give us examples of the typical values involved in the division?

And, (one of) the exact result(s) being displayed?
 
Thanks, Andy.

The input view-query [View_Underforecast_111] is an inner join between 2
tables. It also uses ROUND(x, 1) but its output is as expected:

1st rec: [UFS 1] = 0, [AVERAGE_COST] = 14.23
8th rec: [UFS 1] = 220.7, [AVERAGE_COST] = 110.37

When the view-query [View_Underforecast_111a] applies "ROUND([UFS 1] /
AVERAGE_COST, 1)" the corresponding output is:

1st rec: [UF 1] = .00000000000000000
8th rec: [UF 1] = 2.00000000000000000

So, I guess the rounding function is working, but the output format has too
high a precision.


Andy Hull said:
Hi

Can you give us examples of the typical values involved in the division?

And, (one of) the exact result(s) being displayed?



Allen_N said:
My previous post did not generate a solution, so here I go again. The
following SQL produces a column with 12 decimal places:

SELECT ROUND([UFS 1] / AVERAGE_COST, 1) AS [UF 1]
FROM dbo.View_Underforecast_111

Why isn't it rounding?

I tried putting a form on top of it and setting the format to show 1 decimal
place, but the result is the same!

(This project is an Access 2000-format ADP under Office 2003.)

Thanks!
 
Hi Allen

I haven't been able to duplicate this problem with round so I am only
guessing at possible work arounds without full understanding but have you
tried using "format"

eg

SELECT FORMAT([UFS 1] / AVERAGE_COST, "0.0") AS [UF 1]
FROM dbo.View_Underforecast_111

hth

Andy


Allen_N said:
Thanks, Andy.

The input view-query [View_Underforecast_111] is an inner join between 2
tables. It also uses ROUND(x, 1) but its output is as expected:

1st rec: [UFS 1] = 0, [AVERAGE_COST] = 14.23
8th rec: [UFS 1] = 220.7, [AVERAGE_COST] = 110.37

When the view-query [View_Underforecast_111a] applies "ROUND([UFS 1] /
AVERAGE_COST, 1)" the corresponding output is:

1st rec: [UF 1] = .00000000000000000
8th rec: [UF 1] = 2.00000000000000000

So, I guess the rounding function is working, but the output format has too
high a precision.


Andy Hull said:
Hi

Can you give us examples of the typical values involved in the division?

And, (one of) the exact result(s) being displayed?



Allen_N said:
My previous post did not generate a solution, so here I go again. The
following SQL produces a column with 12 decimal places:

SELECT ROUND([UFS 1] / AVERAGE_COST, 1) AS [UF 1]
FROM dbo.View_Underforecast_111

Why isn't it rounding?

I tried putting a form on top of it and setting the format to show 1 decimal
place, but the result is the same!

(This project is an Access 2000-format ADP under Office 2003.)

Thanks!
 
Back
Top