Results 1 to 3 of 3
  1. #1
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78

    Question Date between query


    Trying to return values that have action dates(ActionDt) which fall between two dates that are inputted on my form CalendarMgr. ActionDt is the field name in my table and TxtDate0 and TxtDate1 are my date ranges from start to end in my form CalendarMgr. If the user doesn't select a date or only selects one date, I want to return all values that have not been restricted by any selected values, or nulls in this case. Below is my query expression. For now it's returning nothing. Not sure where I'm going wrong with this criteria. Thanks in advance!

    [ActionDt] Between [Forms]![frmCalendarMgr]![TxtDate0] And ([Forms]![frmCalendarMgr]![TxtDate1]) Or (IsNull([Forms]![frmCalendarMgr]![TxtDate0])) Or (IsNull([Forms]![frmCalendarMgr]![TxtDate1]))

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Try:

    [ActionDt] Between [Forms]![frmCalendarMgr]![TxtDate0] And [Forms]![frmCalendarMgr]![TxtDate1]) Or [Forms]![frmCalendarMgr]![TxtDate0] Is Null Or [Forms]![frmCalendarMgr]![TxtDate1] Is Null
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    graccess is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    78
    works perfectly, many thanks.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 03-11-2014, 07:32 PM
  2. Replies: 5
    Last Post: 12-12-2013, 12:14 PM
  3. Replies: 1
    Last Post: 05-09-2013, 09:13 AM
  4. Replies: 25
    Last Post: 11-16-2012, 12:47 PM
  5. Replies: 3
    Last Post: 08-21-2012, 03:05 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums