Problem in SQL Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I have been trying to figure out where this message is coming from in my SQL string. Here is the string. The message that I am getting is "The Select statement includes a reserved word or an argument name that is missing or misspelled, or the punctuation is incorrect."

strSQL = "SELECT [Dates for Report Information].[TASK ID],"
strSQL = strSQL & "[Dates for Report Information].[START DATE],"
strSQL = strSQL & "[Dates for Report Information].[END DATE],"
strSQL = strSQL & "[Gov/Contractor Task].[Government Assigned],"
strSQL = strSQL & "[Gov/Contractor Task].[Contractor Assigned],"
strSQL = strSQL & "[Work Description].[Work Description],"
strSQL = strSQL & "[Work Description].[Funding Type],"
strSQL = strSQL & "[Work Description].[JONO],[Materials].[Materials Utilized],"
strSQL = strSQL & "[Materials].[Actual Materials Cost],"
strSQL = strSQL & "[Dates].[Actual Completion Date],[Gov/Contractor Task].[Task Succesfully Completed],"
strSQL = strSQL & "[Gov/Customer Information].[Government],"
strSQL = strSQL & "[Gov/Customer Information].[Customer],"
strSQL = strSQL & "FROM [Gov/Contractor Task],[Work Description],"
strSQL = strSQL & "[Materials],[Dates],[Gov/Customer Information],"
strSQL = strSQL & "[Dates for Report Information],"
strSQL = strSQL & "WHERE (([Dates for Report Information].[START DATE])),"
strSQL = strSQL & "AND (([Dates for Report Information].[END DATE])));"
Thanks for your help.

Jasper
 
Hello Jasper,

In looking at the WHERE clause at the end of your SQL string, there are no
arguments for [START DATE] and [END DATE].


--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Jasper Salary said:
Hi,
I have been trying to figure out where this message is coming from in my
SQL string. Here is the string. The message that I am getting is "The
Select statement includes a reserved word or an argument name that is
missing or misspelled, or the punctuation is incorrect."
strSQL = "SELECT [Dates for Report Information].[TASK ID],"
strSQL = strSQL & "[Dates for Report Information].[START DATE],"
strSQL = strSQL & "[Dates for Report Information].[END DATE],"
strSQL = strSQL & "[Gov/Contractor Task].[Government Assigned],"
strSQL = strSQL & "[Gov/Contractor Task].[Contractor Assigned],"
strSQL = strSQL & "[Work Description].[Work Description],"
strSQL = strSQL & "[Work Description].[Funding Type],"
strSQL = strSQL & "[Work Description].[JONO],[Materials].[Materials Utilized],"
strSQL = strSQL & "[Materials].[Actual Materials Cost],"
strSQL = strSQL & "[Dates].[Actual Completion Date],[Gov/Contractor
Task].[Task Succesfully Completed],"
strSQL = strSQL & "[Gov/Customer Information].[Government],"
strSQL = strSQL & "[Gov/Customer Information].[Customer],"
strSQL = strSQL & "FROM [Gov/Contractor Task],[Work Description],"
strSQL = strSQL & "[Materials],[Dates],[Gov/Customer Information],"
strSQL = strSQL & "[Dates for Report Information],"
strSQL = strSQL & "WHERE (([Dates for Report Information].[START DATE])),"
strSQL = strSQL & "AND (([Dates for Report Information].[END DATE])));"
Thanks for your help.

Jasper
 
You should delete the "," from the sql string before the FROM and WHERE
clauses (the text preceding these clauses) and put space instead.
Also add the values you are comparing to.

sbsmc

Jasper Salary said:
Hi,
I have been trying to figure out where this message is coming from in my
SQL string. Here is the string. The message that I am getting is "The
Select statement includes a reserved word or an argument name that is
missing or misspelled, or the punctuation is incorrect."
strSQL = "SELECT [Dates for Report Information].[TASK ID],"
strSQL = strSQL & "[Dates for Report Information].[START DATE],"
strSQL = strSQL & "[Dates for Report Information].[END DATE],"
strSQL = strSQL & "[Gov/Contractor Task].[Government Assigned],"
strSQL = strSQL & "[Gov/Contractor Task].[Contractor Assigned],"
strSQL = strSQL & "[Work Description].[Work Description],"
strSQL = strSQL & "[Work Description].[Funding Type],"
strSQL = strSQL & "[Work Description].[JONO],[Materials].[Materials Utilized],"
strSQL = strSQL & "[Materials].[Actual Materials Cost],"
strSQL = strSQL & "[Dates].[Actual Completion Date],[Gov/Contractor
Task].[Task Succesfully Completed],"
strSQL = strSQL & "[Gov/Customer Information].[Government],"
strSQL = strSQL & "[Gov/Customer Information].[Customer],"
strSQL = strSQL & "FROM [Gov/Contractor Task],[Work Description],"
strSQL = strSQL & "[Materials],[Dates],[Gov/Customer Information],"
strSQL = strSQL & "[Dates for Report Information],"
strSQL = strSQL & "WHERE (([Dates for Report Information].[START DATE])),"
strSQL = strSQL & "AND (([Dates for Report Information].[END DATE])));"
Thanks for your help.

Jasper
 
Back
Top