Results 1 to 4 of 4
  1. #1
    mkx is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    3

    Between Two Dates - One Parameter Query and one DateAdded


    Hello,


    I am trying to do a query where I ask the user for a date, and then get the results for all the records with that date plus the records that have a date up to the next 4 days that the user entered.


    For example, once the query is run the User will be asked to put in a date and they enter 06/29/15. The query will then add 4 days to it to figure out the end date which would be 07/03/15 and show all the records that have a date from 06/29/15 up to and including 07/03/15.


    Is this possible without using VBA or macros? Any help would be greatly appreciated.

  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,770
    The only option would be a dynamic parameterized query - I NEVER use them.

    SELECT * FROM table WHERE [date field] BETWEEN [enter date] AND [enter date] + 4;
    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
    mkx is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    3
    Would it be better to do the date addition straight in a report instead? Or would it still require the date ranges to be specified in the query?

  4. #4
    mkx is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2015
    Posts
    3
    Never mind I was able to figure it out. Thank you for the help though!

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

Similar Threads

  1. Replies: 2
    Last Post: 02-19-2015, 02:19 PM
  2. Replies: 5
    Last Post: 02-06-2014, 01:11 PM
  3. Replies: 10
    Last Post: 08-29-2013, 09:21 PM
  4. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM
  5. Replies: 2
    Last Post: 11-04-2011, 09:14 AM

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