Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
I get this compile error with syntax. Code is:
Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
"WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action
Items" )= 'Y')); " The double-quotes aren't paired in this WHERE clause... "CurtH" wrote: I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
Meaning that I should use them? What you insert looks exactly like the
original code. "bpeltzer" wrote: "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " The double-quotes aren't paired in this WHERE clause... "CurtH" wrote: I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
If the error is just building the string, then perhaps:
Tested from the immediate window: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _ & " AND ((IMR Action Items)='Y')); " -- Regards, Tom Ogilvy "CurtH" wrote in message ... I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
Meaning that they should alway occur in pairs unless you intend them to be
part of the resulting expression. I don't think you want them in your final SQL expression, but you've got three double quotes on the line (and yes, I posted back exactly your original code to highlight the line that has the imbalance). Perhaps: "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items )= 'Y'));" "CurtH" wrote: Meaning that I should use them? What you insert looks exactly like the original code. "bpeltzer" wrote: "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " The double-quotes aren't paired in this WHERE clause... "CurtH" wrote: I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
Okay. I understand now. Thanks!
"CurtH" wrote: Meaning that I should use them? What you insert looks exactly like the original code. "bpeltzer" wrote: "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " The double-quotes aren't paired in this WHERE clause... "CurtH" wrote: I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
eThanks for the input. Both options seem toresolve the issue. But, now I
get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator) in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'. Once I select debug this line of code is highlighted: ..Open Source:=Src, ActiveConnection:=Connection Please advise. "Tom Ogilvy" wrote: If the error is just building the string, then perhaps: Tested from the immediate window: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _ & " AND ((IMR Action Items)='Y')); " -- Regards, Tom Ogilvy "CurtH" wrote in message ... I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
The parentheses aren't balanced in the SQL statement. Delete one of
the three before UNIT. CurtH wrote: eThanks for the input. Both options seem toresolve the issue. But, now I get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator) in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'. Once I select debug this line of code is highlighted: .Open Source:=Src, ActiveConnection:=Connection Please advise. "Tom Ogilvy" wrote: If the error is just building the string, then perhaps: Tested from the immediate window: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _ & " AND ((IMR Action Items)='Y')); " -- Regards, Tom Ogilvy "CurtH" wrote in message ... I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
Still same result.
"Andrew Taylor" wrote: The parentheses aren't balanced in the SQL statement. Delete one of the three before UNIT. CurtH wrote: eThanks for the input. Both options seem toresolve the issue. But, now I get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator) in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'. Once I select debug this line of code is highlighted: .Open Source:=Src, ActiveConnection:=Connection Please advise. "Tom Ogilvy" wrote: If the error is just building the string, then perhaps: Tested from the immediate window: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _ & " AND ((IMR Action Items)='Y')); " -- Regards, Tom Ogilvy "CurtH" wrote in message ... I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
OK, now i look at it more closely, you need
square brackets round the column names. Try this: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (([UNIT]='125 LOGISTICS READINES SQ')" _ & " AND ([IMR Action Items]='Y')); " CurtH wrote: Still same result. "Andrew Taylor" wrote: The parentheses aren't balanced in the SQL statement. Delete one of the three before UNIT. CurtH wrote: eThanks for the input. Both options seem toresolve the issue. But, now I get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator) in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'. Once I select debug this line of code is highlighted: .Open Source:=Src, ActiveConnection:=Connection Please advise. "Tom Ogilvy" wrote: If the error is just building the string, then perhaps: Tested from the immediate window: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _ & " AND ((IMR Action Items)='Y')); " -- Regards, Tom Ogilvy "CurtH" wrote in message ... I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
Thanks! That did it. I have oneother question. If I want to select
multiple units or all units. How can I edit the "where" code to do so? "Andrew Taylor" wrote: OK, now i look at it more closely, you need square brackets round the column names. Try this: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (([UNIT]='125 LOGISTICS READINES SQ')" _ & " AND ([IMR Action Items]='Y')); " CurtH wrote: Still same result. "Andrew Taylor" wrote: The parentheses aren't balanced in the SQL statement. Delete one of the three before UNIT. CurtH wrote: eThanks for the input. Both options seem toresolve the issue. But, now I get Run-time error' -2147217900 (80040e14)': Syntax error (missing operator) in query "(((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR ACTION TEM)='Y'))'. Once I select debug this line of code is highlighted: .Open Source:=Src, ActiveConnection:=Connection Please advise. "Tom Ogilvy" wrote: If the error is just building the string, then perhaps: Tested from the immediate window: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ')" _ & " AND ((IMR Action Items)='Y')); " -- Regards, Tom Ogilvy "CurtH" wrote in message ... I get this compile error with syntax. Code is: Src = "SELECT * " _ & "FROM MedicalStatus " _ & "WHERE (((UNIT)='125 LOGISTICS READINES SQ') AND ((IMR Action Items" )= 'Y')); " |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help with this error-Compile error: cant find project or library | Excel Discussion (Misc queries) | |||
VBAProject name compile error, not defined at compile time | Excel Programming | |||
error message: compile error, argument not optional | Excel Programming | |||
How do I get rid of "Compile error in hidden module" error message | Excel Discussion (Misc queries) |