I have the following SQL statement in code:
strSQL = "SELECT * FROM TABLEA WHERE F2 = 'SITE'
This returns the record that I expect.
However: the following does not
strSQL = "SELECT * FROM TABLEA WHERE F2 <'SITE'
But if I rewrite it as:
strSQL = "SELECT * FROM TABLEA WHERE Nz(F2,'') <'SITE'
that seems to retrieve records where there may be nulls in column F2.
Let me just say that this table is a holding table for an Excel import so
values could be anything.
Is this correct. That is, I have to use the Nz function when using <>. I
haven't been doing this in some other SQL queries and now realize that I may
be missing some rows that should be returned.
Can someone explain this to me?
Thanks.
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200610/1