Decimal format

J

Jasper Recto

I have a query that does some calculations.

One particular column is a statement that says something like this:

ColumnE = If (columnA = 'HR', ColumnB * ColumnC / ColumnD)

I have set the format to Standard and decimal place to 4 on this column.

Then I have another column that says DSUM( "[ColumnE]", "Costs")

If I go into the properties of this column, it does not give me any options
for the format or decimal places.

When it displays the results, it goes out to over 10 decimal places.

How can I control the decimal places on this column when it does not give me
any options?

Thanks,
Jasper
 
R

Richard

First check the data type of the columns from its Table.... if any of the
column holds a Text data type the decimal place option won't display.....it
will display if you change your field's data type to Number..... Always
ensure that field that will be used in calculations holds a Number Data
type...

More Precisely since the Column A hold Text variables, the Column E cannot
be given a decimal place until the Column A's Data type has been changed to
Number Data type...
 
B

Bob Barrows [MVP]

Jasper said:
I have a query that does some calculations.

One particular column is a statement that says something like this:

ColumnE = If (columnA = 'HR', ColumnB * ColumnC / ColumnD)

I have set the format to Standard and decimal place to 4 on this
column.

Then I have another column that says DSUM( "[ColumnE]", "Costs")

If I go into the properties of this column, it does not give me any
options for the format or decimal places.

When it displays the results, it goes out to over 10 decimal places.

How can I control the decimal places on this column when it does not
give me any options?
First of all, stop hitting the Send button :)

Secondly, you cannot control how a number is stored, but you can control
how it is displayed by using the Format function:

Format(DSUM( "[ColumnE]", "Costs"), ".0000")
 
J

Jasper Recto

Thanks for the info and sorry about the multiple post. I don't know what
exactly happen there!

Jasper
Bob Barrows said:
Jasper said:
I have a query that does some calculations.

One particular column is a statement that says something like this:

ColumnE = If (columnA = 'HR', ColumnB * ColumnC / ColumnD)

I have set the format to Standard and decimal place to 4 on this
column.

Then I have another column that says DSUM( "[ColumnE]", "Costs")

If I go into the properties of this column, it does not give me any
options for the format or decimal places.

When it displays the results, it goes out to over 10 decimal places.

How can I control the decimal places on this column when it does not
give me any options?
First of all, stop hitting the Send button :)

Secondly, you cannot control how a number is stored, but you can control
how it is displayed by using the Format function:

Format(DSUM( "[ColumnE]", "Costs"), ".0000")

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
 

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