472,145 Members | 1,439 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

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
Nov 12 '05 #1
1 3530
Brian Jorgenson wrote:
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


-----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:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

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

iQA/AwUBQHWkYoechKqOuFEgEQISoQCfcME2PJHqxhp7TxQn80a+gH qP0Q0An2SW
TEl6Q5hPL17i/tayY1RBcqtJ
=Nd4f
-----END PGP SIGNATURE-----

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Brian Jorgenson | last post: by
2 posts views Thread by sixdeuce62 | last post: by
11 posts views Thread by lenygold via DBMonster.com | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.