Solved

Help with query criteria and isnull

Posted on 2014-12-01
5
153 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

830 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