Date criteria in Access 2007

Posted on 2010-01-08
Last Modified: 2012-05-08
Hello Experts
I am trying to extract data older than 2 years but can't seem to get the criteria right.  I've tried >Date()-730 but it's not giving me what I need.
Any ideas?
Question by:LillyC
    LVL 1

    Expert Comment

    LVL 92

    Accepted Solution

    Hello LillyC,

    If you want older than two years:

    WHERE DateField < DateAdd("yyyy", -2, Date())



    Author Closing Comment

    Thanks Patrick :@}

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now