Insert Value of 0

Q

quickstudy

Would like to insert an expression to a query showing if quantity equals
blank insert 0. Thanks for the help.
 
K

Ken Snell [MVP]

Define "blank" --- is that an empty string? a null value? something else?

Look up IIf function in the Help files. It's commonly used for this type of
substitution.
 
P

PC Datasheet

Assuming by blank you mean Null, use this:
MyExpression:NZ([NameOfQuantityField],0)

MyExpression will equal Quantity when Quantity has a value and will equal 0
when Quantity is Null.
 
Q

quickstudy

The formula being used is Calc IG: NZ([InwardsGoods]![StockCount],0). This
seems to work; however, the quantities become left justified. Is there away
to right justify them.

Query is against Linked tables.

I also tried using "IIF" but without any luck.

Thanks again!



PC Datasheet said:
Assuming by blank you mean Null, use this:
MyExpression:NZ([NameOfQuantityField],0)

MyExpression will equal Quantity when Quantity has a value and will equal 0
when Quantity is Null.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
[email protected]
www.pcdatasheet.com



quickstudy said:
Would like to insert an expression to a query showing if quantity equals
blank insert 0. Thanks for the help.
 
P

PC Datasheet

Try Calc IG: CLng(NZ([InwardsGoods]![StockCount],0))

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
[email protected]
www.pcdatasheet.com


quickstudy said:
The formula being used is Calc IG: NZ([InwardsGoods]![StockCount],0). This
seems to work; however, the quantities become left justified. Is there away
to right justify them.

Query is against Linked tables.

I also tried using "IIF" but without any luck.

Thanks again!



PC Datasheet said:
Assuming by blank you mean Null, use this:
MyExpression:NZ([NameOfQuantityField],0)

MyExpression will equal Quantity when Quantity has a value and will equal 0
when Quantity is Null.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
[email protected]
www.pcdatasheet.com



quickstudy said:
Would like to insert an expression to a query showing if quantity equals
blank insert 0. Thanks for the help.
 
Top