DateTime Data from Access to Excel using ADO

K

koyannisqatsi

Hi,
I have got a Access Database with a field called "Date" (format: Short
Date). In this field all dates from 31st October to 19th November 2006 are
stored.
I am trying to load data into Excel using a SELECT statement in an ADO
environment but it does not work:

rs = recordset that I have created....
cn = "...connection..."
StartDate = 31.10.2006
EndDate = 02.11.2006
rs.Open "SELECT * FROM Results WHERE [Date] >= StartDate AND
[Date]<=EndDate, cn, , , adCmdText


Thanks for your help!
Dominik
 
A

ADG

Hi

Try

rs.Open "SELECT * FROM Results WHERE [Date] >=" & StartDate & " AND
[Date]<= " & EndDate & ", cn, , , adCmdText"
--
Tony Green


koyannisqatsi said:
Hi,
I have got a Access Database with a field called "Date" (format: Short
Date). In this field all dates from 31st October to 19th November 2006 are
stored.
I am trying to load data into Excel using a SELECT statement in an ADO
environment but it does not work:

rs = recordset that I have created....
cn = "...connection..."
StartDate = 31.10.2006
EndDate = 02.11.2006
rs.Open "SELECT * FROM Results WHERE [Date] >= StartDate AND
[Date]<=EndDate, cn, , , adCmdText


Thanks for your help!
Dominik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top