selecting a specific date range

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

    #1

    selecting a specific date range

    I have a database where in my query I need to be able to locate
    accounts that show a date greater than 14 days from the current date.
    How would I structure this to allow for all accounts that over 14 days
    old from today's date?

    Any help you can give me would be greatly appreciated.
  • fredg

    #2
    Re: selecting a specific date range

    On 21 May 2004 06:29:26 -0700, Catherine wrote:
    [color=blue]
    > I have a database where in my query I need to be able to locate
    > accounts that show a date greater than 14 days from the current date.
    > How would I structure this to allow for all accounts that over 14 days
    > old from today's date?
    >
    > Any help you can give me would be greatly appreciated.[/color]

    Your post is not clear to me whether you wish dates greater than 14
    days into the future, or more than 14 days old.
    As criteria for the date field in the query..

    For dates after June 4th:[color=blue]
    > Date() + 14 ' in the future[/color]

    For dates before May 7th:
    < Date() -14 ' in the past
    --
    Fred
    Please only reply to this newsgroup.
    I do not reply to personal email.

    Comment

    • Johnny Meredith

      #3
      Re: selecting a specific date range

      Create a new query in design view. Close the first box that pops up. On the
      toolbar, click the view button drop down (usually the left most button on the
      bar) and select SQL view. Paste the following into the white screen:

      SELECT *
      FROM Table AS T
      WHERE T.fldDate Between Now() And DateAdd("d",14, Now());


      Change "Table" above to the name of the table where the data is stored.
      Change fldDate to the name of the field in the table that holds the date.
      You can now switch back to design view and modify this query as needed.
      (Note: the DateAdd function allows you to increase dates by any interval.
      Type DateAdd in help search for more info. The Now function returns today's
      date.)

      HTH,
      Johnny

      Comment

      Working...