OK...I'm trying to pull records from the "Sup_Quote_Calculator_Stored_Variable" table 
wether or not
any records exist in these 2 tables (Sup_Branch_Tax_Relationship and 
Sup_Branch_Business_Numbers).

Relationships:
Sup_Quote_Calculator linked to Sup_Quote_Calculator_Stored_Variable via 
Sup_Calculator_ID
Sup_Quote_Calculator linked to Sup_Branch_Business_Numbers via Branch_ID
Sup_Branch_Business_Numbers linked to Sup_Branch_Tax_Relationship via Branch_ID
Sup_Quote_Calculator_Stored_Variable linked to Sup_Branch_Tax_Relationship via 
Cost_Type_ID

I tied using a bunch of OUTER joins in the FROM clause and it returned too many 
records because my
joining sucked, so below is the original query (which works fine if there are records 
in all
tables).  HELP!

      SELECT
        Sup_Quote_Calculator_Stored_Variable.*,
        Sup_Branch_Tax_Relationship.*,
        Sup_Branch_Business_Numbers.Federal_Rate,
        Sup_Branch_Business_Numbers.Provincial_Rate,
        Sup_Branch_Business_Numbers.District_Rate,
        Sup_Branch_Business_Numbers.County_Rate,
        Sup_Branch_Business_Numbers.City_Rate
      FROM
        Sup_Quote_Calculator,
        Sup_Quote_Calculator_Stored_Variable,
        Sup_Branch_Tax_Relationship,
        Sup_Branch_Business_Numbers
      WHERE
        Sup_Quote_Calculator_Stored_Variable.Sup_Calculator_ID = <cfqueryparam
value="#Attributes.Calculator_ID#" cfsqltype="cf_sql_integer">
      AND
        Sup_Quote_Calculator_Stored_Variable.Sup_Calculator_ID =
Sup_Quote_Calculator.Sup_Calculator_ID
      AND
        Sup_Quote_Calculator.Branch_ID = Sup_Branch_Tax_Relationship.Branch_ID
      AND
        Sup_Branch_Tax_Relationship.Branch_ID = Sup_Branch_Business_Numbers.Branch_ID
      AND
        Sup_Quote_Calculator_Stored_Variable.Cost_Type_ID = 
Sup_Branch_Tax_Relationship.Cost_Type_ID
      AND
        Sup_Quote_Calculator_Stored_Variable.Cost_Type_ID IS NOT NULL

Thanks in advance

Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
t. 250.920.8830
e. [EMAIL PROTECTED]

---------------------------------------------------------
Macromedia Associate Partner
www.macromedia.com
---------------------------------------------------------
Vancouver Island ColdFusion Users Group
Founder & Director
www.cfug-vancouverisland.com

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to