for that, you can do:
SELECT Fomat([Acquisto]/[Netto]*100),'0.00') AS Percentuale FROM YourTable
or
SELECT Round((1/3*100),2) AS Percentuale FROM Master
the only problem you can have is that you might have the field [Netto] equal
to Null or 0
so you'll have an error because you'll have a division by 0!
for that you can use the following condition:
Percentuale: iif(IsNull([Netto]) or [Netto]=0,'NA',
Fomat([Acquisto]/[Netto]*100),'0.00'))
Rossy said:
I've got this in the structure of a query
Percentuale: [Acquisto]/[Netto]*100
Acquisto and Netto are 2 values of the table
I need Percentuale to be round to two decimals
Warrio said:
Hi!
You can use the functions Round(number, nbDec) or Format(Number,"0.00")
"Rossy" <[email protected]> a écrit dans le message de
(e-mail address removed)...
Do you simply want to display the result as percentage with 2 decimal places
or do you need the rounded value for further calculations?
For the first case, you can simply set the Format of the Field (column in
the Query grid) to "Percent". For the later, you can use the Round()
function.
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.