Skip to Content
author's profile photo Former Member
Former Member

Help with linking 3 tables

Hi,

I'm having trouble with a report. I would like to show all 'Deployed' and 'Auto-Added' Computers of all 'Active' Organizations.

I have 3 Tables: Computers, Organizational_Units, Status

When I just use Organization and Satus this is the SQL query it shows:

SELECT "Status"."Status", "Organizational_Units"."Name"

FROM "TEB-AlloyNavigatorDB6"."dbo"."Organizational_Units" "Organizational_Units" INNER JOIN "TEB-AlloyNavigatorDB6"."dbo"."Status" "Status" ON "Organizational_Units"."Status_ID"="Status"."ID"

WHERE "Status"."Status"=N'Active'

When I add Computers, the report is empty. The SQL is:

SELECT "Status"."Status", "Organizational_Units"."Name", "Computers"."Computer_Name"

FROM ("TEB-AlloyNavigatorDB6"."dbo"."Computers" "Computers" INNER JOIN "TEB-AlloyNavigatorDB6"."dbo"."Organizational_Units" "Organizational_Units" ON "Computers"."Organization_ID"="Organizational_Units"."ID") INNER JOIN "TEB-AlloyNavigatorDB6"."dbo"."Status" "Status" ON ("Computers"."Status_ID"="Status"."ID") AND ("Organizational_Units"."Status_ID"="Status"."ID")

WHERE "Status"."Status"=N'Active'

Can anyone help me with this? To me it seems like Status is linked in a wrong way??

Edited by: B. Kleer on Sep 8, 2011 3:02 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2011 at 02:00 PM

    Hi Kleer,

    Please check the following Query and try to create a crystal report with the following query

    SELECT "Status"."Status", "Organizational_Units"."Name", "Computers"."Computer_Name"

    FROM ("TEB-AlloyNavigatorDB6"."dbo"."Computers" "Computers" INNER JOIN "TEB-AlloyNavigatorDB6"."dbo"."Organizational_Units" "Organizational_Units" ON "Computers"."Organization_ID"="Organizational_Units"."ID") INNER JOIN "TEB-AlloyNavigatorDB6"."dbo"."Status" "Status" ON ("Computers"."Status_ID"="Status"."ID")

    WHERE "Status"."Status"=N'Active'

    Thanks,

    Naga.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 08, 2011 at 02:43 PM

    Hi kleer,

    Thanks for your response. I suggested you, create a new crystal report by using the query through ADD Command.

    SELECT "Status"."Status", "Organizational_Units"."Name", "Computers"."Computer_Name"

    FROM ("TEB-AlloyNavigatorDB6"."dbo"."Computers" "Computers" INNER JOIN "TEB-AlloyNavigatorDB6"."dbo"."Organizational_Units" "Organizational_Units" ON "Computers"."Organization_ID"="Organizational_Units"."ID") INNER JOIN "TEB-AlloyNavigatorDB6"."dbo"."Status" "Status" ON ("Computers"."Status_ID"="Status"."ID")

    WHERE "Status"."Status"=N'Active'

    Thanks,

    Naga.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 13, 2011 at 07:33 PM

    If you have built your report through Crystal's database editor, can you post your links here? I suspect your need to modify your link for status to an outer join.

    Debi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.