Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2009
    Posts
    16

    Unanswered: Filter specific week

    Hello

    What I am trying to do is to enter a date and filter a query to show that date and the previous 6 days.
    Last edited by ratte; 12-01-09 at 00:13.

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Can you be a little more specific. You can put criteria on your date field (using the WHERE) and then add an expression to 'group by' the first day of the week (ie: StartOfWeek: Format(([MyDateField]-Weekday([MyDateField]))+1,"mm/dd/yyyy")
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Sep 2009
    Posts
    16
    Sorry

    What I got is form with a textfield.
    In that texfield I will type my date.
    After entering that date i will click on a button which will open a report based on my query.

    That date is the criteria for my query.
    The query will then show just that date and the previous 6 days.

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    In the recordsource (ie. query) for your report, for the date field column, add criteria such as:

    Between Forms!MyDataForm!MyDateField and dateadd("d",-6,Forms!MyDataForm!MyDateField)
    or
    Between Forms!MyDataForm!MyDateField and Forms!MyDataForm!MyDateField-6
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Sep 2009
    Posts
    16

    Smile

    Thanks Mate

Posting Permissions

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