Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry

    I need to add a where clause to the following statement. The criteria needs to be < the value (date) in forms!frmPaSu!txtDt, if there is one. Needs to return all records if there is no user entered value in the text box.

    SELECT tblTest.lngTestID, tblTest.strTestTypeK, tblTest.lngVehID, tblTest.dtmDtTmS AS dtmCurDt, tblTest.strPurposeK
    FROM tblTest;

    Need some help.

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    [quote name='ppem' post='773009' date='30-Apr-2009 14:06']I need to add a where clause to the following statement. The criteria needs to be < the value (date) in forms!frmPaSu!txtDt, if there is one. Needs to return all records if there is no user entered value in the text box.

    SELECT tblTest.lngTestID, tblTest.strTestTypeK, tblTest.lngVehID, tblTest.dtmDtTmS AS dtmCurDt, tblTest.strPurposeK
    FROM tblTest;

    Need some help.[/quote]
    Try this

    Where (((tblTest.dtmDtTmS)<[Forms]![frmPaSu]![txtDt])) OR (([Forms]![frmPaSu]![txtDt] Is Null))
    Regards
    John



  3. #3
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Cedar Falls, Iowa, USA
    Posts
    268
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='johnhutchison' post='773011' date='29-Apr-2009 21:35']Try this

    Where (((tblTest.dtmDtTmS)<[Forms]![frmPaSu]![txtDt])) OR (([Forms]![frmPaSu]![txtDt] Is Null))[/quote]

    Nailed it. Thanks

Posting Permissions

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