Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With VBA editor I am trying to build a select statement that extracts data
from the Task table in MS Project. The select by itself works fine, however when I try to filter the data with a Where clause I get an error. Statement: rsSelect = "Select TaskUniqueId, TaskName, TaskSummary From Tasks Where TaskSummary = " & chr(34) & "False" & chr(34) & "Order by TaskUniqueId" When I run the statement I get the error: Invalid column name "False" Why does it think this string value "False" is a column? What is wrong with this syntax? I just want to select rows that are not summary tasks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You may need a carrage returns. The Where requires a new line when I used it
for ACCESS. Not sure if the same applies for project. I have project at work an not at home. Try this rsSelect = "Select TaskUniqueId, TaskName, TaskSummary" & vbcrlf & _ "From Tasks" & vbcrlf & _ "Where TaskSummary = " & chr(34) & "False" & chr(34) & vbcrlf & _ "Order by TaskUniqueId" You don't need chr(34) you can use two sets of double quotes. This is your preference. I use both styles depending on how bad the code looks. The chr(34) sometimes make the code harder to read and sometimes easier. I also like using line continuation character to make the code easier to read. rsSelect = "Select TaskUniqueId, TaskName, TaskSummary" & vbcrlf & _ "From Tasks" & vbcrlf & _ "Where TaskSummary = ""False"" & vbcrlf & _ "Order by TaskUniqueId" "dbonline" wrote: With VBA editor I am trying to build a select statement that extracts data from the Task table in MS Project. The select by itself works fine, however when I try to filter the data with a Where clause I get an error. Statement: rsSelect = "Select TaskUniqueId, TaskName, TaskSummary From Tasks Where TaskSummary = " & chr(34) & "False" & chr(34) & "Order by TaskUniqueId" When I run the statement I get the error: Invalid column name "False" Why does it think this string value "False" is a column? What is wrong with this syntax? I just want to select rows that are not summary tasks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I import and merge Excel data into a master project file? | Excel Discussion (Misc queries) | |||
Can I import data from MS Project into Excel or vice-versa? | Excel Discussion (Misc queries) | |||
How do I import MS Project data into Excel? | Excel Discussion (Misc queries) | |||
How do I import MS Project data into Excel? | Excel Discussion (Misc queries) | |||
How do I import data from Microsoft Project 2003 to Excel? | Excel Discussion (Misc queries) |