Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incorrect syntax in SQL Statement

Status
Not open for further replies.

jasonhuibers

Programmer
Sep 12, 2005
290
CA
What is wrong with this statement? I keep getting error:
Incorrect syntax near 'EventHistory'


sql_insert = "SELECT Event.EventName,Event.EventType,COUNT(*) FROM EVENT WITH (NOLOCK) " & _
"INNER JOIN EventHistory WITH (NOLOCK) ON Event.RecordNum = EventHistory.RecordNum" & _
"WHERE EventHistory.RecordNum = 2 AND EventHistory.Vendor is not null" & _
"GROUP BY Event.EventName,Event.EventType"
 
Looks like you are missing a space after EVENTHISTORY.RECORDNUM and before the WHERE.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top