LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Excel VB - WHERE syntax error in Access web query.

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!

 
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
syntax error in VBA in query from Access Winget Excel Discussion (Misc queries) 0 January 21st 10 07:49 PM
Excel 2007 MS Query prompt yields Syntax error Bruce Excel Discussion (Misc queries) 0 May 26th 06 11:06 AM
runtime error: syntax error or access violation oucsester[_2_] Excel Programming 1 May 3rd 06 05:51 PM
MS Query import from Excel - Syntax Error EstherJ Excel Discussion (Misc queries) 1 April 24th 06 09:44 AM
Syntax Error in Excel Query for DATE field James T Excel Discussion (Misc queries) 3 August 31st 05 12:33 PM


All times are GMT +1. The time now is 09:42 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"