Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2003
    Posts
    6

    Unanswered: Automatic Dated Ranged Queries

    I have a database that has records that are Date Stamped (Short Date). I need a query that can run that will give only the new records from the current week (current date minus seven days). This needs to be completely automated so that I can implement it into a macro. Any ideas?

  2. #2
    Join Date
    Feb 2003
    Location
    Auckland, NZ
    Posts
    150
    In the criteria of your query for the date use the following formula

    = DateAdd("d", -7, Now)



    another option would be:

    = DateAdd("ww", -1, Now)
    JJ Kennedy
    Double J IT Solutions
    www.doublejit.co.nz

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

  3. #3
    Join Date
    Apr 2003
    Posts
    6

    Unhappy

    After I enter the string into the criteria field, the query returns no data. I have tried both strings and both give the same results.

  4. #4
    Join Date
    Dec 2002
    Location
    Columbus, GA
    Posts
    81
    Try this criteria

    On the date field in the query, put in the criteria

    Between Date()-7 and Date()

  5. #5
    Join Date
    Feb 2003
    Location
    Auckland, NZ
    Posts
    150
    I made a mistake in my previous post Try

    > instead of =
    JJ Kennedy
    Double J IT Solutions
    www.doublejit.co.nz

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

Posting Permissions

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