I want this query to only show 2 decimal places. How can I do such?
Code:Calculation: Nz([Red],0)-(Nz([Blue],0)+Nz([Green],0)+Nz([Yellow],0)+Nz([Red],0)+Nz([Salmon],0)+Nz([Mustard],0)+Nz([Orange],0)+Nz([Macaroni],0)+Nz([Small],0)/(1-0.41))
I want this query to only show 2 decimal places. How can I do such?
Code:Calculation: Nz([Red],0)-(Nz([Blue],0)+Nz([Green],0)+Nz([Yellow],0)+Nz([Red],0)+Nz([Salmon],0)+Nz([Mustard],0)+Nz([Orange],0)+Nz([Macaroni],0)+Nz([Small],0)/(1-0.41))
DO I have to put the round() function on each field in my query or can I encompass the entire equation in it like thisSee if this Round info helps.
Code:Calculation: ROUND(Nz([Red],0)-(Nz([Blue],0)+Nz([Green],0)+Nz([Yellow],0)+Nz([Red],0)+Nz([Salmon],0)+Nz([Mustard],0)+Nz([Orange],0)+Nz([Macaroni],0)+Nz([Small],0)/(1-0.41)),2)
Encompassing the whole thing will work just fine, just verify you get the result you expect.
Out of curiousity why you are dividing by 1 - .41 rather than .59?
Round (expression,NumberOfDecimalPlaces)
You know that is an excellent question. That is the formula that was given to me to use (converting an Excel spreadsheet into a database or trying rather...) --- hadn't thought twice about double checking the formula.
I'm only pointing it out because I really try to avoid hard coding formulas if I can avoid it to allow the database to be as flexible as possible. If that is a value that can change over time it should be accounted for in your database design.
That is a very good thought and question. I will inquire on that one.