?
Solved

Help with query criteria and isnull

Posted on 2014-12-01
5
Medium Priority
?
165 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1000 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 51

Assisted Solution

by:Gustav Brock
Gustav Brock earned 1000 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 48

Expert Comment

by:Dale Fye
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

762 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