Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 select query inner join question

Author  Topic 

reddymade
Posting Yak Master

165 Posts

Posted - 2007-01-03 : 12:53:40
I have the following select query still working on it, but want to make an inner join confused at the following 2 inner join lines:
INNER JOIN TAB_ccsNetModuleLinks LNK on CN.CNID = LNK.ModuleRecordID
INNER JOIN TAB_CCSNETCO CO on LNK.LINKMODULERECORDID = CO.COID


****************************************************************

SELECT CN.CNNO, CN.CNTYPE, CN.CNTitle, CONVERT(varchar(10), CN.CNLOGGEDDATE, 101) AS CNLOGGEDDATE,
CN.CNID, rtrim(isnull(A.ActionDescription,'''')) as ActionDescription,
CONVERT(varchar(10), CN.PDNeedDate, 101) AS [When]
FROM TAB_ccsNetCN AS CN JOIN TAB_ccsNetUserAccess AS U ON (CN.ProgID = U.ProgID AND CN.ProjID = U.ProjID AND CN.ContractID = U.ContractID)
INNER JOIN TAB_ccsNetModuleLinks LNK on CN.CNID = LNK.ModuleRecordID
INNER JOIN TAB_CCSNETCO CO on LNK.LINKMODULERECORDID = CO.COID
INNER JOIN TAB_ccsNetPrograms PG ON CN.ProgID = PG.ProgID
INNER JOIN TAB_ccsNetProjects PJ ON CN.ProjID = PJ.ProjID
INNER JOIN TAB_ccsNetContracts CT ON CN.ContractID = CT.ContractID
INNER JOIN TAB_ccsNetActions A ON CN.CNID = A.ModuleRecordID

*************************************************************

Thank you very much for the information.

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-01-03 : 13:21:17
I'm afraid I don't understand what you are asking. Do you have a specific question?

- Jeff
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-01-03 : 13:25:17
You want to make the query confused?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-01-03 : 14:56:43
.. or you want to make SQLTeam confused ? Done!

- Jeff
Go to Top of Page

reddymade
Posting Yak Master

165 Posts

Posted - 2007-01-03 : 15:19:03
Jeff, I am sorry...
Here is the query:

****************************************************************
SELECT CN.CNNO, CN.CNTYPE, CN.CNTitle, A.ActionDescription,CO.CONO
FROM TAB_ccsNetCN AS CN JOIN TAB_ccsNetUserAccess AS U ON (CN.ProgID = U.ProgID AND CN.ProjID = U.ProjID AND CN.ContractID = U.ContractID)
INNER JOIN TAB_ccsNetModuleLinks LNK on CN.CNID = LNK.ModuleRecordID
INNER JOIN TAB_CCSNETCO CO on LNK.LINKMODULERECORDID = CO.COID
INNER JOIN TAB_ccsNetPrograms PG ON CN.ProgID = PG.ProgID
INNER JOIN TAB_ccsNetProjects PJ ON CN.ProjID = PJ.ProjID
INNER JOIN TAB_ccsNetContracts CT ON CN.ContractID = CT.ContractID
INNER JOIN TAB_ccsNetActions A ON CN.CNID = A.ModuleRecordID
*****************************************************************

Can i use these two innerjoins in the above query or they are wrong:
INNER JOIN TAB_ccsNetModuleLinks LNK on CN.CNID = LNK.ModuleRecordID
INNER JOIN TAB_CCSNETCO CO on LNK.LINKMODULERECORDID = CO.COID

Please let me know. Thank you.
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-01-03 : 15:24:42
How can we tell you if they are wrong? We have no idea what tables you are working with, what the data looks like, what columns are present in those tables, what data types they are, or what you are trying to return.

It is like if I asked you: "When I drive home tonight, I want to go left at the end of the road and then turn right. Is that correct?" Could you possibly answer that question for me based on the information I've provided for you and what you know about me and where I live?

Anyway, did you TRY it? What happens? Isn't that easier and faster than posting a question here and awaiting a response?

- Jeff
Go to Top of Page
   

- Advertisement -