How do I move (INSERT+DELETE) the last n rows from a table in Jet SQL / Access 2003? -
I have a system that receives input from the public each day. When it starts every morning, I use a VB script Which will move every input into more than 500 backup tables. This system is a complete collection of activity.
I want to proceed from every line (from table 'active' to table 'active' in table 'collection' and then remove row from 'active') initial 500 rows (sorted by column Has been) from one table to another.
I was hoping to be able to do this as a single SQL statement, but I have not had much success. Is this a proper way to do a proper (nested) jet in the form of a SQL statement? Need to write some intermediate VB scripts to handle this action?
Thanks in advance,
It seems that I may have to do something like this .
Log in ChatArt (MsgId, MsgText, Filtered, LostFetched) SELECT MsgID, MsgText, Filtered, Last Feast with WHERE id & lt; = (Select from ChatCurrent MAX (id) - 500; Delete from ChatCurrent MsgId & lt; = (Select from ChatArchive MAX (MsgId); 500 Being the number of rows here I want to be in the system. Alternatively the MsgIds The list is to be stored anywhere (in VB) and to create another query from it.
Comments
Post a Comment