Solved

Help with query criteria and isnull

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

Accepted Solution

by:
Rey Obrero earned 250 total points
Comment Utility
remove the bracket [ after 0,

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

Expert Comment

by:Phillip Burton
Comment Utility
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
Comment Utility
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
Comment Utility
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)
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now