formatnumber to format a sum field in query?

smile

Registered User.
Local time
Yesterday, 18:49
Joined
Apr 21, 2006
Messages
212
I have a query that calculates a sum like this:

Sum: [table1]![field1]*[table1]![field2]

I would like result to have 2 decimal places.

I tried to use formatnumber like this:

Formatnumber(Sum: [table1]![field1]*[table1]![field2];2)

But I get syntax error. please help with the correct formula.
 
I'm guessing, but try

Formatnumber(Sum([table1]![field1]*[table1]![field2]);2)
 
I'm guessing, but try

Formatnumber(Sum([table1]![field1]*[table1]![field2]);2)

I was thinking too complicated, I just needed to set format to currency in the Query Columns property sheet...
 
But how can I format a number entered into table using query based on another field I select?

I now use this formula in my query:
http://www.access-programmers.co.uk/forums/showthread.php?t=144666

But perhaps I can force access to do this:

If I enter 0,5 and select kilogram it changes my input to 0,500 and stores this number in table

If I enter 5 and select pieces than it changes(doesn't change) to 5 and stores this number in table
 

Users who are viewing this thread

Back
Top Bottom