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
|
|||
|
|||
Running a query against it's own base table
I am developing an application which is sort an inventory system. What I need
to do is load last month or weeks data minus the new product additions. This, I want to leave blank for obvious reasons, however, I do not wish to have to re-enter all the same data again. The data structure and product remain the same through-out the week, month or years with minor additions. Is it possible to use a query to load last month or weeks data into the same table leaving the Add/Count column blank and then, tag the update with the date in the date column in which the update was done? I know I've seen it some place before, is it possible. If so, how? Thanks, |
#2
|
|||
|
|||
It would help if you could post the fields in the table in question: it is
certainly possible, but how you go about it depends a lot on whether you have the month or week in the table. Something like this: INSERT INTO Inventory ( DateColumn, Product ) SELECT Now() AS UpdateDate, Inventory.Product FROM Inventory WHERE (((Inventory.DateColumn)=[Enter Start Date]) AND ((Inventory. DateColumn)=[Enter End Date])) GROUP BY Now(), Inventory.Product; If you want to automate this some more, you need to figure out you are going to determine last month or last week from the current date - still not too bad. This also puts a Date & Time in the DateColumn, which you can change by using the DateSerial and Now() functions together. -- Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error when running Query, but not Report | Blaze | Running & Setting Up Queries | 29 | September 9th, 2005 05:40 AM |
Help again from Ken Snell (Query) | Randy | Running & Setting Up Queries | 22 | August 29th, 2005 08:15 PM |
Unable to edit records in a form or query | Merlin | Using Forms | 7 | May 10th, 2005 02:00 PM |
Union Query Not Returning A Value | Jeff G | Running & Setting Up Queries | 2 | October 19th, 2004 05:47 PM |
Big number gives error! | Sara Mellen | Running & Setting Up Queries | 8 | October 11th, 2004 02:48 AM |