Click to See Complete Forum and Search --> : That is Null and Is not Null problem


aussiecyclone
April 1st, 2001, 10:13 PM
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)

GungaDin
April 1st, 2001, 10:26 PM
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

SheriLW
April 1st, 2001, 10:27 PM
Hi,

The statement should be
sql= "Select * from Customers where MaildateSent is not null and FollowUpDate is null Order by CompanyName"

Iouri
April 2nd, 2001, 08:15 AM
Try this SQL
SQL = "SELECT * FROM Customers WHERE IsNull(MailDateSent) = False and IsNull(FollowUpDate) = False ORDER bY CompanyName"


Iouri Boutchkine
iouri@hotsheet.com

Spectre
April 2nd, 2001, 02:10 PM
One last permutation, this should work too...

Select * From Customers Where Not MailDateSent = Null And FollowUpDate = Null

Hope this helps.
Spectre