C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

Incorrect syntax near the keyword 'inner'.


Posted Date: 01 Sep 2007      Posted By: Mohamed Yasin      Member Level: Gold     Points: 2   Responses: 1



HI..
Can anyone please help me with this Error. Incorrect syntax near the keyword 'inner'.
Query is:

SELECT iCalls_Calls.CALL_ID,C.CALL_ID, iCalls_Calls.REQUESTOR, iCalls_Users.USER_NAME, DESCRIPTION, TYPE, SCOPE, SEVERITY, CAST(E.COUNT1/F.COUNT2 AS VarChar(5)), iCalls_Calls.STATUS_ID, iCalls_Status.STATUS_ID, iCalls_Status.STATUS_LABEL FROM iCalls_Calls C INNER JOIN(SELECT CALL_ID,COUNT(CALL_ID)AS COUNT1 FROM iCalls_Events GROUP BY CALL_ID) E ON C.CALL_ID=E.CALL_ID INNER JOIN(SELECT CALL_ID,COUNT(CALL_ID)AS COUNT2 FROM iCalls_Events WHERE EVENTS_FLAG <> 0 GROUP BY CALL_ID ) F ON C.CALL_ID=F.CALL_ID ((iCalls_Calls inner join iCalls_Status on iCalls_Calls.STATUS_ID=iCalls_Status.STATUS_ID) inner Join iCalls_Users on iCalls_Calls.REQUESTOR=iCalls_Users.USER_ID) left outer join iCalls_Messages on iCalls_Calls.CALL_ID=iCalls_Messages.CALL_ID WHERE REQUESTOR='" & Session("USER_ID") & "' AND iCalls_Calls.STATUS_ID <> 6 ORDER BY iCalls_Calls.CALL_ID

Thanks a lot..





Responses

Author: Jayaprakashbalraj    03 Sep 2007Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

SELECT iCalls_Calls.CALL_ID,C.CALL_ID, iCalls_Calls.REQUESTOR, iCalls_Users.USER_NAME,
DESCRIPTION, TYPE, SCOPE, SEVERITY, CAST(E.COUNT1/F.COUNT2 AS VarChar(5)),
iCalls_Calls.STATUS_ID, iCalls_Status.STATUS_ID, iCalls_Status.STATUS_LABEL
FROM iCalls_Calls C INNER JOIN(SELECT CALL_ID,COUNT(CALL_ID)AS COUNT1
FROM iCalls_Events GROUP BY CALL_ID) E ON C.CALL_ID=E.CALL_ID
INNER JOIN(SELECT CALL_ID,COUNT(CALL_ID)AS COUNT2
FROM iCalls_Events WHERE EVENTS_FLAG <> 0 GROUP BY CALL_ID ) F
ON C.CALL_ID=F.CALL_ID
inner join iCalls_Status on (iCalls_Calls.STATUS_ID=iCalls_Status.STATUS_ID)
inner Join iCalls_Users on (iCalls_Calls.REQUESTOR=iCalls_Users.USER_ID)
left outer join iCalls_Messages on iCalls_Calls.CALL_ID=iCalls_Messages.CALL_ID
WHERE REQUESTOR='" & Session("USER_ID") & "' AND iCalls_Calls.STATUS_ID <> 6
ORDER BY iCalls_Calls.CALL_ID

just try this.......



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : how to delete data base in SQLExpress & MSDE
Previous : What is Order by,compute,having,Distinct,Group by
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use