469,653 Members | 1,803 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,653 developers. It's quick & easy.

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 3420
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 gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.