Query Records from a specific Date Range

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Terry

    #1

    Query Records from a specific Date Range

    I have a database that I would like to query for a specific date
    range.

    I want to create a report based on this query that will pull any
    records from the last 7 days.

    Is this possible? Can someone tell me how it is done?

    Thanks.
  • Jim Allensworth

    #2
    Re: Query Records from a specific Date Range

    Use the Between ... And operators on the dates. Something like...

    Between #1/1/04# And #5/31/04#

    To return values from first of the year thru end of May.

    You can also use the Date() function to reference the current date.

    Between #1/1/04# And Date()

    To return values year to date.

    Type these into the criteria row of the QBE window.

    - Jim

    On 29 Jun 2004 16:03:41 -0700, twlandry@eatel. net (Terry) wrote:
    [color=blue]
    >I have a database that I would like to query for a specific date
    >range.
    >
    >I want to create a report based on this query that will pull any
    >records from the last 7 days.
    >
    >Is this possible? Can someone tell me how it is done?
    >
    >Thanks.[/color]

    Comment

    • Don Leverton

      #3
      Re: Query Records from a specific Date Range

      Hi Terry,

      I think that using:
      " >DateAdd("d", -7, Date())"
      In the Criteria row of your query should do the trick.

      SELECT YourTableName.*
      FROM YourTableName
      WHERE (((YourTableNam e.YourDate)>Dat eAdd("d",-7,Date())));


      --
      HTH,
      Don
      =============== ==============
      Use My.Name@Telus.N et for e-mail
      Disclaimer:
      Professional PartsPerson
      Amateur Database Programmer {:o)

      I'm an Access97 user, so all posted code
      samples are also Access97- based
      unless otherwise noted.

      Do Until SinksIn = True
      File/Save, <slam fingers in desk drawer>
      Loop

      =============== =============== ==

      "Terry" <twlandry@eatel .net> wrote in message
      news:64cfb463.0 406291503.1677a 9ad@posting.goo gle.com...[color=blue]
      > I have a database that I would like to query for a specific date
      > range.
      >
      > I want to create a report based on this query that will pull any
      > records from the last 7 days.
      >
      > Is this possible? Can someone tell me how it is done?
      >
      > Thanks.[/color]


      Comment

      Working...