That is Null and Is not Null problem
Hi,
I am trying to populate a combo with the following Where clause. There is something wrong with my code.
Any help appreciated.
Regards,
Alan.
SQL = "SELECT * FROM Customers ORDER bY CompanyName" & "WHERE MailDateSent Is Not Null" & "FollowUpDate Is Null"
Set Customers = DB.OpenRecordset(SQL, dbOpenDynaset)
Re: That is Null and Is not Null problem
You need to put the ORDER BY Clause last. I think you're query should read:
SQL = "SELECT * FROM Customers WHERE MailDateSent Is Not Null AND FollowUpDate Is Null ORDER bY CompanyName"
Hope this helps,
Nathan Liebke
Re: That is Null and Is not Null problem
Hi,
The statement should be
sql= "Select * from Customers where MaildateSent is not null and FollowUpDate is null Order by CompanyName"
Re: That is Null and Is not Null problem
Try this SQL
SQL = "SELECT * FROM Customers WHERE IsNull(MailDateSent) = False and IsNull(FollowUpDate) = False ORDER bY CompanyName"
Iouri Boutchkine
[email protected]
Re: That is Null and Is not Null problem
One last permutation, this should work too...
Select * From Customers Where Not MailDateSent = Null And FollowUpDate = Null
Hope this helps.
Spectre