Thanks much!
"Dorian" wrote:
[Quoted Text] > > strSql = "INSERT INTO tblCandidatesArchive " > > strSql = strSql & " IN 'J:\Bak\PFS\Recruiting\MyCandidateArchiveTable.mdb' " > > strSql = strSql & " SELECT * FROM tblCandidates" > > strSql = strSql & " WHERE Archive <= #" & Date & "#" & _ > OR CALL_RESULTS = 'Skipped';" > > > strSql = "DELETE FROM tblCandidates" > > strSql = strSql & " WHERE Archive <= #" & Date & "#" & _ > OR CALL_RESULTS = 'Skipped';" > > -- Dorian > "Give someone a fish and they eat for a day; teach someone to fish and they > eat for a lifetime". > > > "Rod" wrote: > > > Hello, > > > > I and doing an archive and would like to make a simple change but can't > > figure it out. Here is the code: > > > > 'Step 1: Initialize database object inside a transaction. > > Set ws = DBEngine(0) > > ws.BeginTrans > > bInTrans = True > > Set db = ws(0) > > > > 'Step 2: Execute the append. > > strSql = "INSERT INTO tblCandidatesArchive " > > strSql = strSql & " IN 'J:\Bak\PFS\Recruiting\MyCandidateArchiveTable.mdb' " > > strSql = strSql & " SELECT * FROM tblCandidates" > > strSql = strSql & " WHERE Archive <= #" & Date & "#;" > > > > db.Execute strSql ', dbFailOnError > > > > 'Step 3: Execute the delete. > > strSql = "DELETE FROM tblCandidates" > > strSql = strSql & " WHERE Archive <= #" & Date & "#;" > > db.Execute strSql ', dbFailOnError > > > > I would like to change the WHERE statements to not only check the date but > > if CALL_RESULTS = Skipped then archive that record as well. > > > > Thanks.
|