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

selecting a specific date range

P: n/a
I have a database where in my query I need to be able to locate
accounts that show a date greater than 14 days from the current date.
How would I structure this to allow for all accounts that over 14 days
old from today's date?

Any help you can give me would be greatly appreciated.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 21 May 2004 06:29:26 -0700, Catherine wrote:
I have a database where in my query I need to be able to locate
accounts that show a date greater than 14 days from the current date.
How would I structure this to allow for all accounts that over 14 days
old from today's date?

Any help you can give me would be greatly appreciated.
Your post is not clear to me whether you wish dates greater than 14
days into the future, or more than 14 days old.
As criteria for the date field in the query..

For dates after June 4th: Date() + 14 ' in the future


For dates before May 7th:
< Date() -14 ' in the past
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #2

P: n/a
Create a new query in design view. Close the first box that pops up. On the
toolbar, click the view button drop down (usually the left most button on the
bar) and select SQL view. Paste the following into the white screen:

SELECT *
FROM Table AS T
WHERE T.fldDate Between Now() And DateAdd("d",14,Now());
Change "Table" above to the name of the table where the data is stored.
Change fldDate to the name of the field in the table that holds the date.
You can now switch back to design view and modify this query as needed.
(Note: the DateAdd function allows you to increase dates by any interval.
Type DateAdd in help search for more info. The Now function returns today's
date.)

HTH,
Johnny
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.