Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2012
    Posts
    14

    Unanswered: How to compbine 2 query from diffenent table

    Hello

    I have write two query but its only work one at a time need your expertise what i am doing wrong.

    [Category].Category AS project_type,
    [SalesManager].SalesManager As Manager,

    FROM [Category] INNER JOIN (Projects INNER JOIN [MO/FSC] ON Projects.ProjectID = [MO/FSC].Project)
    ON [Category].ID = Projects.Category

    FROM [SalesManager] INNER JOIN (Projects INNER JOIN [MO/FSC] ON Projects.ProjectID = [MO/FSC].Project)
    ON [SalesManager].ID = Projects.SalesManagerID


    Thanks in Advance.
    Arpit

  2. #2
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    Try this:
    Code:
    SELECT
    	[Category].Category AS project_type,
    	[SalesManager].SalesManager As Manager
    FROM 
    	Projects
    	INNER JOIN [Category] ON
    		[Category].ID = Projects.Category
    	INNER JOIN [MO/FSC] ON 
    		Projects.ProjectID = [MO/FSC].Project
    	INNER JOIN [SalesManager] ON
    		[SalesManager].ID = Projects.SalesManagerID
    You can even leave out the JOIN with [MO/FSC].
    Last edited by Wim; 04-05-12 at 22:01.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  3. #3
    Join Date
    Mar 2012
    Posts
    14
    Thank you very much for all your help. I am new with sql and trying to follow someone footstep which is no longer with the company.

    Your query work like a charm.

    Thanks Again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •