Access Query Date Range

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

    Access Query Date Range

    I am looking for a formula to put in my query to pull data based on
    the last 3 months. It starts with the current day and will go back 3
    months.

    Here is my wrkflow language for example:

    CURRENT_DATE = current date

    PAST_DATE = CURRENT_DATE - 3 months

    SELECT RANGE PAST_DATE to CURRENT_DATE

    END


    Thanks for any help
  • MGFoster

    #2
    Re: Access Query Date Range

    Brian Jorgenson wrote:
    [color=blue]
    > I am looking for a formula to put in my query to pull data based on
    > the last 3 months. It starts with the current day and will go back 3
    > months.
    >
    > Here is my wrkflow language for example:
    >
    > CURRENT_DATE = current date
    >
    > PAST_DATE = CURRENT_DATE - 3 months
    >
    > SELECT RANGE PAST_DATE to CURRENT_DATE
    >
    > END[/color]

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    SELECT *
    FROM TableName
    WHERE DateColumn BETWEEN DateAdd("m", -3, Date()) And Date()

    DateAdd:
    "m" = use months as the interval
    -3 = interval to "add" to indicated date
    Date() = indicated date (current date)

    See the Access VBA Help article on DateAdd() Function and Date()
    function.

    --
    MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
    Oakland, CA (USA)

    -----BEGIN PGP SIGNATURE-----
    Version: PGP for Personal Privacy 5.0
    Charset: noconv

    iQA/AwUBQHWkYoechKq OuFEgEQISoQCfcM E2PJHqxhp7TxQn8 0a+gHqP0Q0An2SW
    TEl6Q5hPL17i/tayY1RBcqtJ
    =Nd4f
    -----END PGP SIGNATURE-----

    Comment

    Working...