Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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')); " |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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) |