PC Review


Reply
Thread Tools Rate Thread

DateTime Data from Access to Excel using ADO

 
 
=?Utf-8?B?a295YW5uaXNxYXRzaQ==?=
Guest
Posts: n/a
 
      27th Nov 2006
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QURH?=
Guest
Posts: n/a
 
      27th Nov 2006
Hi

Try

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

--
Tony Green


"koyannisqatsi" wrote:

> 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

 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      27th Nov 2006
See also this page
http://www.rondebruin.nl/accessexcel.htm

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


"koyannisqatsi" <(E-Mail Removed)> wrote in message
news:22DE563F-9BAF-4D54-B2AA-(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. M. Bruil Microsoft Access 2 26th Mar 2009 08:30 AM
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. M. Bruil Microsoft Access 0 25th Mar 2009 08:10 PM
datetime format issues when linking access to excel =?Utf-8?B?U2Vhc29u?= Microsoft Excel Misc 0 6th Dec 2005 04:52 PM
data access page - default current date in datetime control =?Utf-8?B?VG9tIEJyb3BoeQ==?= Microsoft Access VBA Modules 0 16th Aug 2005 04:07 PM
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. luna Microsoft ASP .NET 1 13th Feb 2004 01:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:56 AM.