Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
mxp
 
Posts: n/a
Default excel - access query - date range


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


Formula:
--------------------
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'})
--------------------


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 like



Formula:
--------------------
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 )
--------------------


many thanks
mxp


--
mxp
------------------------------------------------------------------------
mxp's Profile: http://www.excelforum.com/member.php...o&userid=30994
View this thread: http://www.excelforum.com/showthread...hreadid=506755

  #2   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin
 
Posts: n/a
Default excel - access query - date range

hi mxp

Look on this page

You can use a cell with the date or see the example file where you can save different criteria.
http://www.rondebruin.nl/accessexcel.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"mxp" wrote in message ...

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


Formula:
--------------------
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'})
--------------------


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 like



Formula:
--------------------
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 )
--------------------


many thanks
mxp


--
mxp
------------------------------------------------------------------------
mxp's Profile: http://www.excelforum.com/member.php...o&userid=30994
View this thread: http://www.excelforum.com/showthread...hreadid=506755



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking Large Access Table into Excel Steven M. Britton Links and Linking in Excel 1 December 30th 05 11:28 PM
How do I enter a date range ie -7 from current date in MS QUERY notsmartenough Excel Discussion (Misc queries) 1 November 11th 05 10:17 PM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM
Syntax Error in Excel Query for DATE field James T Excel Discussion (Misc queries) 3 August 31st 05 12:33 PM
Query a Access database that has a module from Excel Oggie Excel Discussion (Misc queries) 1 January 4th 05 08:43 AM


All times are GMT +1. The time now is 12:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"