Append query field value, put 0 instead of blank.

MushroomKing

Registered User.
Local time
Yesterday, 18:26
Joined
Jun 7, 2018
Messages
100
Hey folks!

Im stuck with this query. I don't fully understand where im making the mistake here.

Some times, the query returns null (blank).
In that case i want the value to be 0.

The part i also dont understand:
It's append query. When i put the default value as 0 in the table it appends to, it doesn't work either.

How can i solve this query, and why does the default dont work in my table?

Thanks in advance!

scanquantity.png
 
yes, use Nz([quantity],0) instead of Nz(scanquantity)
 
Thanks for reply Ranman!

Well, when i put NZ([scanquantity],0) it asks me for parameter when i run it.
When i put NZ([quantity],0) i get an error:


the specified field [quantity] could not refer to more than one table listed

what is happening?
 
then qualify with correct Table name:

NZ([TableNameHere].[quantity],0)
 
Aaaah yes.

Indeed, i have 2 fields with quantity from different tables.
I thought access would figure this out because im telling it from which table.

But this is better :)

Thanks. Next time i will name my fields different in the different tables

Cheers!
 
cheers friend!
 
Ai...not there yet.

Now it says:

Your query does not include the specified expression
Sum(Scanned.quantity)=Nz([Scanned].[quantity],0) as part of an
aggregate function



:confused:
 
firstly, you cannot update an Aggregate query.
if you are not updating it, adding that Expression as Group (Group by Sum(Scanned.quantity)=Nz([Scanned].[quantity],0) may solve the problem.
 

Users who are viewing this thread

Back
Top Bottom