strDocName Error

I'm not sure what point you were making. Of course, anything like this gives the same result

Code:
SELECT * FROM TableName WHERE 1=0;
Hi Colin. Was that directed at me? If so, I was just offering a response to Micron trying to support one of Pat's earlier point, which was 1=0 is the same (equivalent) to 1=Null when it's used in a WHERE clause. Again, I better let Pat explain herself further from now on. Cheers!
 
I think there is a risk this is just turning into semantics and I'm guilty of that below as well.

Micron is of course absolutely correct that a null isn't equal to anything else, not even another null.
As far as any WHERE condition is concerned, the outcome is obviously either True or False. Including Null could perhaps best be described as Not True rather than False but the effect is the same as being False. However as DBG just stated Access will change =Null (meaningless) to Is Null (meaningful).

Has the above helped at all? I doubt it...:rolleyes:
 
I think this might boil down to one's concept of what the Where clause is and what it does - at least it has become that IMHO. By definition, it specifies criteria that field values must meet for the records that contain the values to be included in the query results. If an expression evaluates to true or false and true or false is what the field contains, it ought to work if you pass the result as criteria regardless of whether or not it returns the expected records. If the expression evaluates to true or false and the field does not contain true or false values, I'd expect it to not return records and perhaps raise a data type mismatch error. If the expression returns Null and you pass =Null to the criteria clause, you will raise the error I already mentioned. If you pass 'Null' (without the quotes) Access query def will convert it to Is Null as I said. I don't know if it will do that in the case of vba generated sql but I'm not inclined to test it as it would just be a factoid about something that we should never be dealing with anyway. By that I mean if one has an inherent understanding of the basics of Null in terms of sql, you ought to be doing everything to prevent it or convert it unless you are specifically looking for records where the field has no values and does not hold an empty string.

So I do agree with Isladogs re semantics, assuming we agree on the basics about Null.
 

Users who are viewing this thread

Back
Top Bottom