Solved

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

Posted on 2004-09-01
4
388 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

757 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

22 Experts available now in Live!

Get 1:1 Help Now