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
Solved

Access query that uses a dynamically created date

Posted on 2008-06-26
2
217 Views
Last Modified: 2013-11-27
I apologize if the question title wasn't appropriately named, but it was hard to try to come up with the words.

I want to create an Access query that deletes any record in a table that is older than 30 days ago from the current date.

I'm familiar with writing SQL statements, but not one that would use a variable type element as with this example.

Is there a way to do this in Access?
0
Comment
Question by:zrancidr
2 Comments
 
LVL 18

Accepted Solution

by:
jmoss111 earned 250 total points
ID: 21875094
If you have some date in the table that contains the reference date then "DELETE * FROM MyTable WHERE MyDate < Date() - 30;"
0
 

Author Closing Comment

by:zrancidr
ID: 31470968
I should have just gone ahead and tried to do that myself...that was my initial inclination.  Thanks!!
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

856 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