I am trying to figure out how i can run an access query in excel and change the date range of the query without altering the query itself.
i have written the query
and have managed to successfully import the data into excel. What is the easiest way to allow a date range to be added without the need to alter the query ie is it possible to pass variables to the query - so the query would be something likePHP Code:
SELECT Payments.id, Payments.Name, Payments.PaymentID, Payments.PaymentDate, Payments.`ex vat`, Payments.`ex vat`*0.175 AS 'vat', (Payments.`ex vat`*0.175)+Payments.`ex vat` AS 'total'
FROM table
WHERE (Payments.PaymentDate<={ts '2004-12-01 00:00:00'} And Payments.PaymentDate>={ts '2004-08-01 00:00:00'})
many thanksPHP Code:
SELECT Payments.id, Payments.Name, Payments.PaymentID, Payments.PaymentDate, Payments.`ex vat`, Payments.`ex vat`*0.175 AS 'vat', (Payments.`ex vat`*0.175)+Payments.`ex vat` AS 'total'
FROM table
WHERE (Payments.PaymentDate<= $end And Payments.PaymentDate>= $start )
mxp
Bookmarks