View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Patrick Dave Patrick is offline
external usenet poster
 
Posts: 249
Default Excel VB - WHERE syntax error in Access web query.

Does this code run in access or excel? Using ADO? What data source provider
are you using?

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

wrote:
| Greetings,
|
| I searched and found several posts and tried to use them to find out
| where I am going wrong but no luck. I am attempting to run a query
| from a database that will look to a specific sheet in the workbook for
| the date range to be used.
|
| This works:
| "SELECT `Time ( < 16 )`.`Employee ID`, `Time ( < 16 )`.`System
| ID`, `Time ( < 16 )`.`Project Code`, `Time ( < 16 )`.SumOfHours, `Time
| ( < 16 )`.`First Name`, `Time ( < 16 )" _
| , "`.`Last Name`" & Chr(13) & "" & Chr(10) & "FROM
| `X:\Time\TKS`.`Time ( < 16 )` `Time ( < 16 )`")
|
| This doesn't:
| "SELECT `Time ( < 16 )`.`Employee ID`, `Time ( < 16 )`.`System
| ID`, `Time ( < 16 )`.`Project Code`, `Time ( < 16 )`.SumOfHours, `Time
| ( < 16 )`.`First Name`, `Time ( < 16 )" _
| , "`.`Last Name`" & Chr(13) & "" & Chr(10) & "FROM
| `X:\Time\TKS`.`Time ( < 16 )` `Time ( < 16 )`" & Chr(13) & "" &
| Chr(10) & "WHERE(`Time ( < 16 )`.Date)10/10/06")
|
| It returns a general odbc error.
|
| I added :
|
| & Chr(13) & "" & Chr(10) & "WHERE(`Time ( < 16 )`.Date)10/10/06")
|
| Any help is appreciated. The ultimate goal is to have the 10/10/06
| reference two cells and possibly have a from and to selection but I had
| seen enough on the variable piece I figure I could do that once I had
| the basics down.
|
| Thanks!
|