G
Graeme
I am trying to do what I thought would be simple, but am finding it
difficult.
I want to write a query which extracts all records from a table suign a
date criteria. I want to store this date somewhere, and then next time
I run the same query, I want to extract only records since the last
time the query was run.
e.g - first time I run the query (on 06/08/05) I extract these.
Customer Sales Date Sales Value
AB001 05/08/05 12.00
AB003 05/08/05 18.20
AB001 06/08/05 13.00
Next Time I run the query, (on 08/08/05) the 'Sales' Table contains
Customer Sales Date Sales Value
AB001 05/08/05 12.00 Not needed
AB003 05/08/05 18.20 Not needed
AB001 06/08/05 13.00 Not needed
AB001 07/08/05 17.65 << want this
AB001 07/08/05 13.55 << Want This
AC004 08/08/05 25.00 << Want This
I.e. I only want to extract records added to the sales table SINCE
06/08/2005,
I cannot 'prompt' for the last-run date, since I am trying to automate
this query to ru overnight (using Macro's and Windows Scheduler)
NOTE: all the dates I illustrate are UK format, ie. (dd/mm/yy)
Any idea's ?
all help gratefully appreciated.
difficult.
I want to write a query which extracts all records from a table suign a
date criteria. I want to store this date somewhere, and then next time
I run the same query, I want to extract only records since the last
time the query was run.
e.g - first time I run the query (on 06/08/05) I extract these.
Customer Sales Date Sales Value
AB001 05/08/05 12.00
AB003 05/08/05 18.20
AB001 06/08/05 13.00
Next Time I run the query, (on 08/08/05) the 'Sales' Table contains
Customer Sales Date Sales Value
AB001 05/08/05 12.00 Not needed
AB003 05/08/05 18.20 Not needed
AB001 06/08/05 13.00 Not needed
AB001 07/08/05 17.65 << want this
AB001 07/08/05 13.55 << Want This
AC004 08/08/05 25.00 << Want This
I.e. I only want to extract records added to the sales table SINCE
06/08/2005,
I cannot 'prompt' for the last-run date, since I am trying to automate
this query to ru overnight (using Macro's and Windows Scheduler)
NOTE: all the dates I illustrate are UK format, ie. (dd/mm/yy)
Any idea's ?
all help gratefully appreciated.