Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Import MS Project Data through Query

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Import MS Project Data through Query

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
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
How do I import and merge Excel data into a master project file? Sentry16 Excel Discussion (Misc queries) 0 June 11th 07 03:39 PM
Can I import data from MS Project into Excel or vice-versa? OfficeGreenBean Excel Discussion (Misc queries) 3 December 31st 06 03:36 AM
How do I import MS Project data into Excel? mk Excel Discussion (Misc queries) 1 March 30th 05 07:57 PM
How do I import MS Project data into Excel? mk Excel Discussion (Misc queries) 0 March 16th 05 04:23 PM
How do I import data from Microsoft Project 2003 to Excel? RgilbertProjMgr Excel Discussion (Misc queries) 3 December 31st 04 01:07 PM


All times are GMT +1. The time now is 03:00 AM.

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"