Re: Query Records since last run

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Store the value in a table, text file, registry setting, or global variable.
Pick anyone, and retrieve it before or during the query.


--
Steve Clark, Access MVP
FMS, Inc.
Call us for all of your Access Development Needs!
1-888-220-6234
Consulting@xxxxxxxxxx
www.fmsinc.com/consulting

"Graeme" <gorchard@xxxxxxxxxxx> wrote in message
news:1123526611.668574.124070@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>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.
>


.



Relevant Pages

  • No, not exactly!
    ... at the query or report. ... The sales data is sent to us from a third party and I ... MonthName MonthNum Store #Cust $Sales Avg#Txn ... I want my report to print: ...
    (microsoft.public.access.reports)
  • Re: Excel Query error
    ... >> I've created an Excel query which pulls monthly sales. ... >> The criteria fields are store, sales accounts, month ...
    (microsoft.public.excel.misc)
  • RE: Reduce # of date columns in crosstab query
    ... "Sales by Product temp" for that product, so it won't show up no matter how I ... it from the final calculation in the crosstab query. ... the criteria out of the crosstab and into something like the original query. ... You could use the column headings to limit the number of columns; ...
    (microsoft.public.access.queries)
  • Re: Was: what does "serialization" mean?
    ... > The data volumes in the case of Walmart are huge ... the sales and inventory database has ... WHATEVER would probably be a separate query to summarize total sales. ... Indeed the psychology of hardware efficiency encourages flaccid design ...
    (comp.programming)
  • Re: Incorrect subtotals in a report
    ... You can create multiple values by combining a crosstab and cartesian query. ... > sales, ... > Subsection 01 subtotals for all of the above quantities. ... whilst the daily totals are incorrect. ...
    (microsoft.public.access.reports)