LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default SQL query in Excel 2000 using VBA

Brandon,
I'm no DB expert, but a couple of thing would simplify your task.
There no point formatting the SQL statement with "& Chr(13) & "" & Chr(10)"
as this is irrelevant to ADO, unless you want it to look nice in the debug
window.
Not sure how ADO would handle the "{" barcket in the SQL, unless they are
required by your DB.

Depending on how the data is held in "Range("A3").Value" you may be
returning an unexpected value to the dtest variable.
Add a Debug.Print dtest and see what is being passed.

To me it seems that the part "{ts '" & dtest & "'}" would evalaute to
something like
{ts '08-Apr-04 8:00:43 PM'}
which is probably not what you are storing in the DB, as the ts variable is
not being evaluated as it is in the string.

If you wish to use the "(" brakets for clarity, it would be better to
contain to two caparions either side of the AND separately.

Hope that helps.

NickHK


"Brandon" <bdreilingATmac.com wrote in message
...
Thanks for your reply.

The two variables will create a date/time range.

={ts '" & dtest & "'} is to state greater or equal to a date and

timestamp, such as 2004-04-07 00:00:00 and the next variable will state
less than or equal to 2004-04-08 00:00:00.

Basically it is scaling down to a 24 hour time frame that will change
each day.

Thanks for your help,
Brandon

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



 
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
Error using Data Query within Excel 2000 thunter Excel Discussion (Misc queries) 1 April 12th 10 08:21 PM
MS Query will not start from Excel 2000 Ian Excel Discussion (Misc queries) 8 May 21st 09 01:09 PM
Edit query in excel 2000 Joel Nieto Excel Discussion (Misc queries) 0 April 17th 06 09:31 PM
Excel 2000 hangs on new database query XP quasar Excel Discussion (Misc queries) 0 April 8th 06 07:31 PM
Question on MS Query in Excel 2000 Bill[_19_] Excel Programming 2 October 22nd 03 08:08 PM


All times are GMT +1. The time now is 01:30 PM.

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

About Us

"It's about Microsoft Excel"