Solved

WHERE IsNull([Field]) or WHERE [Field] Is Null?

Posted on 2004-09-01
4
389 Views
Last Modified: 2006-11-17
OK folks,

bit of a techie question here. The question (and hence answer) will be of no practical value but I'm curious as to your thoughts. Incidentally, it was triggered by the question 'SQL Query Numeric Field Null Value' below...

Take a very simple query...

SELECT * FROM [Table] WHERE [Field] Is Null

Is this the quickest way of running it, or would WHERE IsNull([Field]) be quicker?

My personal thinking is that SQL runs within Access as a set of compiled functions, with the Is (as in Is Null) operator being a standard part. The function IsNull() must presumably be called from within whatever set of functions Access uses to process SQL, thereby making it (fractionally) slower. However, I am far from convinced that this is correct. To bump this up to the full 500 points, can anybody give me a detailed explanation of how Access processes SQL? i.e. are SELECT, INSERT and so on effectively pointers to built in functions; is there a whole layer of interpretation / optimisation to get through first or is there some other process entirely going on?

Just curious...

Cheers,

s46.
0
Comment
Question by:solution46
  • 2
  • 2
4 Comments
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 11956182
Since "Is Null" is a native Jet operator whereas IsNull() is a VBA function, Is Null will always be faster as you don't have the overhead of passing the value through to the VBA engine.

SQL queries are processed by the Jet engine, not Access, which is essentially a shell. There are a bunch of optimisations that Access makes to the query path, and MS's patented (i.e. bought) Rushmore technology. Let me see if I can dig out an on-line reference for you. The Jet Programmer Guide would give you more information though.
0
 
LVL 9

Author Comment

by:solution46
ID: 11956232
Ahhh.. bloody obvious about IsNull() really.

By Access, I really meant Jet, as in the part that does the work! Where can I get hold of the Jet Programmer's Guide? Is that a M$ publication or third party?

s46.

0
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 500 total points
ID: 11956296
It's a Micro$oft publication:
http://www.amazon.co.uk/exec/obidos/ASIN/1572313420/qid=1094063257/ref=sr_8_xs_ap_i1_xgl/026-7399276-4787624

That should be for Jet 3.5 - not sure if there is an updated version for Jet 4.
0
 
LVL 9

Author Comment

by:solution46
ID: 11956367
Many thanks - I'll see if I can find a copy lying round a bookshop.

The (hopefully 500) points are now yours.

s46.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

911 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

20 Experts available now in Live!

Get 1:1 Help Now