If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Delete query
I want to Delete data that is 548 days from Date() on close in a form. I can
create a query statement Date-548 but how do I get the delete part? |
#2
|
|||
|
|||
On Mon, 5 Sep 2005 22:14:01 -0700, "Nick"
wrote: I want to Delete data that is 548 days from Date() on close in a form. I can create a query statement Date-548 but how do I get the delete part? CurrentDb.Execute "DELETE * FROM mytable WHERE [datefield] DateAdd("d", -548, Date())" John W. Vinson[MVP] |
#3
|
|||
|
|||
Thanks John.
Is this a query or Macro. If it a Macro I am not familiar to setting those up. Would you elaborate more on how and where I set them up? "John Vinson" wrote: On Mon, 5 Sep 2005 22:14:01 -0700, "Nick" wrote: I want to Delete data that is 548 days from Date() on close in a form. I can create a query statement Date-548 but how do I get the delete part? CurrentDb.Execute "DELETE * FROM mytable WHERE [datefield] DateAdd("d", -548, Date())" John W. Vinson[MVP] |
#4
|
|||
|
|||
On Tue, 6 Sep 2005 08:30:19 -0700, "Nick"
wrote: Thanks John. Is this a query or Macro. If it a Macro I am not familiar to setting those up. Would you elaborate more on how and where I set them up? Sorry, this was VBA code. Just create a Delete query in the query design window. Put DateAdd("d", -548, Date()) on the Criteria line under the date field that you wish to search. You can then run the query manually, or from a Macro or from VBA code. John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Toolbars, Drop-Down Menus | Rick | New Users | 1 | September 21st, 2005 11:17 AM |
Access 2k/2003: Touble with delete query using WHERE EXISTS | Darin | Running & Setting Up Queries | 17 | August 25th, 2005 06:58 PM |
Delete Query | Lou | Running & Setting Up Queries | 5 | May 17th, 2005 06:24 PM |
Delete query won't run! | faramir | Running & Setting Up Queries | 7 | February 7th, 2005 03:26 AM |
Here's a shocker | Mike Labosh | General Discussion | 2 | October 26th, 2004 05:04 PM |