By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,377 Members | 3,052 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,377 IT Pros & Developers. It's quick & easy.

Access Query Date Range

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.