CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2001
    Posts
    29

    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)




  2. #2
    Join Date
    Mar 2001
    Location
    Australia
    Posts
    146

    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





  3. #3
    Join Date
    Mar 2001
    Posts
    6

    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"


  4. #4
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    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]
    Iouri Boutchkine
    [email protected]

  5. #5
    Join Date
    Feb 2000
    Posts
    137

    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



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured