423,682 Members | 1,327 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,682 IT Pros & Developers. It's quick & easy.

Can't Format a field in a Query thats Calculated

P: 96
Expand|Select|Wrap|Line Numbers
  1. ProductionLost: Nz(([UnplannedDowntime]+[sumofchangeoverminutes])*[AvgOfCalcLineSpeed],0)
I can put in the format as Standard, but it will not allow me to change the decimal place.

What did I do wrong?

Thanks for the help.
Sep 6 '18 #1

✓ answered by NeoPa

As you've used NZ(), it doesn't realise that the result is numeric. NZ() returns a Variant value.

Try instead :
Expand|Select|Wrap|Line Numbers
  1. ProductionLost: CDbl(Nz(([UnplannedDowntime]+[sumofchangeoverminutes])*[AvgOfCalcLineSpeed],0))
Another type-conversion function may suit you better but this one will work and illustrates the point well enough.

Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,084
As you've used NZ(), it doesn't realise that the result is numeric. NZ() returns a Variant value.

Try instead :
Expand|Select|Wrap|Line Numbers
  1. ProductionLost: CDbl(Nz(([UnplannedDowntime]+[sumofchangeoverminutes])*[AvgOfCalcLineSpeed],0))
Another type-conversion function may suit you better but this one will work and illustrates the point well enough.
Sep 6 '18 #2

P: 96
Thank you, this worked awesomely. I'll need to remember that one.
Sep 6 '18 #3

NeoPa
Expert Mod 15k+
P: 31,084
Any time DJ :-)

Glad I could help.
Sep 6 '18 #4

Post your reply

Sign in to post your reply or Sign up for a free account.