[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

MS Access 2010 Date help

Posted on 2014-12-08
2
Medium Priority
?
219 Views
Last Modified: 2014-12-08
Hi
Need help with the following please.
We have a query that contains a date field. What we cant to do is add 7 days to this date and then show the last 30 days from today.
So for example I have the following

Date in Table           Add 7 Days      
01/09/2014              08/09/2014
01/12/2014              08/12/2014
02/12/2014             09/12/2014

I can get the query to add 7 days and show the correct date, but I also then want the query to only show me records that have a date from today 30 days back based on the new date I have created, so from the example above the would only return 2 records that have a date in December.  I cant seem to do that as I can seem to add a query to the field that creates the new date, If I try and then run the query I get the "enter parameter value"

Thanks
0
Comment
Question by:George_Milton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 40486494
It would help if you'd show the SQL of your query.

Adding 7 days is straight forward:

SELECT Field1, DateAdd("d", 7, YourDateField) AS NewDate FROM SomeTable

This would create a column named NewDate in the query, and would add 7 days to a field named YourDateField.

If you then want to query and filter on YourDateField for values starting at 30 days in the past:

SELECT YourDateField, DateAdd("d", 7, YourDateField) AS NewDate FROM SomeTable WHERE YourDateField >= DateAdd("d" , -30, Now)
0
 

Author Closing Comment

by:George_Milton
ID: 40486502
Thank you that worked exactly as I expected
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question