Solved

Help with query criteria and isnull

Posted on 2014-12-01
5
145 Views
Last Modified: 2014-12-01
What is wrong with:

Qty On Hand: IIf(IsNull([SumOfQTY_ORDERED]),0,[[SumOfQTY_ORDERED])
0
Comment
Question by:SteveL13
5 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 40473673
remove the bracket [ after 0,

Qty On Hand: IIf(IsNull([SumOfQTY_ORDERED]),0,[SumOfQTY_ORDERED])
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40473698
Or alternatively, use Nz([SumOfQTY_ORDERED],"")

But don't give me points for this answer please - Rey was here before me.
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40473707
I don't think you need ANY of the hard brackets, as you are not using a field with a space or other "illegal" character. It might clear it all up.
0
 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 250 total points
ID: 40473744
If this is SQL, you should use:

    IIf([SumOfQTY_ORDERED] Is Null,0,[SumOfQTY_ORDERED])

If VBA, then:

    Nz([SumOfQTY_ORDERED], 0)

/gustav
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 40473982
No points please.

As indicated, removing all of the [ and ] brackets should solve your problem, but I agree with Phillip, I would recommend using the NZ function

Qty On Hand: NZ([SumOfQTY_ORDERED],0)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question