Results 1 to 5 of 5
  1. #1
    fpmsi is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    16

    Query by date

    I need to select a group of records for a mailing that have not been mailed to in the last 90 days. This is based off a field called "Import_Date". The field is formatted as mmyyyy (092011).



    Table: tblMailing
    Field: Import_date (092011)

    Steps:
    Import Database - gets coded as say (122011)
    need to have a query that selects all those new records (122011) and dedupes by first/last/city against records from the last two months so that it can be exported for the mailing.

    So basically it would not select records that were imported in the last two months by those fields. Its a 90 day dedupe process

    Any help would be greatly appreciated.

    Thanks

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I'm confused. What is the relationship between 092011 and 122011. Do you want your query to return all records having a date greater than 092011 or greater than 122011. Your explanation is not quite clear to me. Please try again.

    Alan

  3. #3
    fpmsi is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    16
    Sorry: Basically i just need to select records by the last 3 months.

    SELECT *
    FROM tblMailing
    WHERE ([Import_Date] Between DateAdd("d",-90,Date()) And Date());

    Then dedupe and collect the remaining records.


    I think i have this process completed if my theory is correct:

    Qry Select all records in table from last 90 days.
    Dedupe query wizard by First/Last/City
    Show unmatched query between the two results (90 day selected and dupe wizard)
    Select records from unmatched that equal month(now())

    Ryan.

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    What happens when you test your theory? Works? Errors?

    Alan

  5. #5
    fpmsi is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    16
    Sorry - I was still working on the queries as I responded to your comments.

    It all seems to be working - although the duplication process isn't the best. May have to look for a better way to dedupe as the strict dedupe is missing dupes.

    Thanks again.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. query to update a date based on another date
    By tkendell in forum Access
    Replies: 3
    Last Post: 06-29-2011, 09:32 PM
  2. Date Query
    By vimrcds in forum Queries
    Replies: 2
    Last Post: 01-29-2011, 04:28 PM
  3. Date query help!!!
    By dduvvuru in forum Queries
    Replies: 2
    Last Post: 08-27-2010, 12:59 PM
  4. Date query
    By Philangr8 in forum Queries
    Replies: 7
    Last Post: 10-06-2009, 04:37 PM
  5. Replies: 2
    Last Post: 07-31-2009, 06:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums