I have a query that every day pulls yesterday's data from an sql database and drops it into Access.
What I need it to do though is when today's date is a Monday, I need it to gather the data for Friday, Saturday and Sunday, otherwise run the standard code.
So on a monday we have a special code that runs and picks up the last three days worth of data, every other day we want it to just pick up yesterdays data.
I hope that makes sense.
Thanks
SQL:
SELECT Date, InvoiceNo, Customer
FROM SalesDatabase
WHERE Date=Yesterdaysdate
What I need it to do though is when today's date is a Monday, I need it to gather the data for Friday, Saturday and Sunday, otherwise run the standard code.
So on a monday we have a special code that runs and picks up the last three days worth of data, every other day we want it to just pick up yesterdays data.
I hope that makes sense.
Thanks