Results 1 to 2 of 2

Thread: between date query ?

  1. #1
    Join Date
    Oct 2006
    Posts
    6

    between date query ?

    any help with this will be much appreciated. Sorry for the length but I’m trying to be as thorough as possible to try and figure this out.
    I am developing an Access DB to collect data from several teams, about 12 or 13 of them.
    The data is pretty straightforward. It’s a Point of Contact DB where I have one table with name, address, phone, e-mail, etc.
    There are three date fields with this date format: 12/04/2006.
    The first date field is called: Create/Edit Date.
    When they create the record they input that day’s date. The second date field is Edit Date.
    If they make any changes to an existing record then that date is updated to the date the change was made.
    The last date field is Transmit Date.
    Every Friday they export this file to an Excel spreadsheet and e-mail it.
    Since the table is growing daily they don’t want to re-transmit records that have already been created and transmitted.

    Starting with Saturday, each record that is created or updated has that date moving forward. On Friday what I want to be able to do is to run a Query to capture all data created or edited from the Previous Saturday until Friday.
    I hope to have a form with two date fields, a ‘from’ date and a ‘to’ date.
    They will click on a small calendar icon that will open a calendar where they click on the previous Saturday. Right next to it another calendar icon where they click on Friday’s date and then a submit button.
    When they click submit it will capture only the records between those two date and produce an excel spreadsheet with the data.
    I have done the export to excel before, it’s just setting the criteria in the query designer to run a query of ‘between’ values.
    Anyone have any idea how to pull this off?

  2. #2
    Join Date
    May 2006
    Posts
    407
    In the criteria row of the date you want to filter, you can enter this:
    Code:
    Between Forms!frmTwoDateFields!FromDate 
        And Forms!frmTwoDateFields!ToDate
    Because you will want new records within the past week, or any records edited within the last week, you will need to put this same "Between ... and ..." in the criteria row for both date columns. But, you need to be sure they are NOT on the same row. If they are on the same row, they will be in an AND relationship. On different lines, the two criteria will be in an OR relationship, which is what you want in this case.
    Hope this helps,
    Vic

Posting Permissions

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