Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Oct 2003
    Location
    Wyoming, USA
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query based on date field (Access XP)

    Some background. I have a table that is created in a Palm Pilot and when the Hot Sync is done is then made into a ODBC compatible file. One of the fields in this table is a date field that is generated when there is a change made to that record. The date is the date of the change.

    I want to create a query that will tell me when something has not been changed within the last 7 days. What function do I use to create this? And what would the syntax be?

    TIA

    Bret

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query based on date field (Access XP)

    Import or link the table into your Access database.
    Create a query based on the table.
    Drag the fields you want to see from the field list to the query grid, including the date field.
    In the column of the date field, enter the following in the Criteria: line:

    <Date()-7

    The query will return all records whose change date is more than a week ago. The Date() function returns the current date (today), by subtracting 7 we get the date exactly a week ago. You can create your own variations on this theme.

  3. #3
    Star Lounger
    Join Date
    Oct 2003
    Location
    Wyoming, USA
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query based on date field (Access XP)

    Hans,

    You are terrrrriiiifffffiiicccc! Thank you so much.

    Bret

Posting Permissions

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