Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820

    Unhappy Unanswered: more problems with odbc

    Anyone know whats it's playing at this time

    Code:
    SELECT 
    BoM2.PPART AS Parent,
    IIf([BoM2].[QTYPA]=0,
    	IIf(BoM2_1.QTYPA=0,
    		BoM2_2.CPART,
    		BoM2_1.CPART
    	),
    	[BoM2].[CPART]
    ) AS FirstCom, 
    
    [BoM2].[QTYPA]+
    IIf(IsNull(BoM2_1.QTYPA),
    	0,
    	BoM2_1.QTYPA
    )+
    IIf(IsNull(BoM2_2.QTYPA),
    	0,
    	BoM2_2.QTYPA
    ) AS Weights
    
    FROM (BoM2 LEFT JOIN BoM2 AS BoM2_1 ON BoM2.CPART = BoM2_1.PPART) 
    LEFT JOIN BoM2 AS BoM2_2 ON BoM2_1.CPART = BoM2_2.PPART
    WHERE (((BoM2.PPART) Like "[!gm]*"));
    
    SELECT 
    BoM.Parent,
    IIf([BoM].[Weight]=0,
    	IIf(BoM_1.Weight=0,
    		BoM_2.Component
    		,BoM_1.Component
    	),
    	[BoM].[Component]
    ) AS FirstCom,
    
    [BoM].[Weight]+
    IIf(IsNull(BoM_1.Weight),
    	0,
    	BoM_1.Weight
    )+
    IIf(IsNull(BoM_2.Weight),
    	0,
    	BoM_2.Weight
    ) AS Weights
    
    FROM (BoM LEFT JOIN BoM AS BoM_1 ON BoM.Component = BoM_1.Parent) 
    LEFT JOIN BoM AS BoM_2 ON BoM_1.Component = BoM_2.Parent
    WHERE (((BoM.Parent) Like "[!gm]*"));
    the top one uses ODBC the bottom one doesn't and the latter works fine i get the invalid 'operation error'
    Last edited by m.timoney; 12-06-02 at 10:15.
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820
    SELECT BoM2.PPART AS Parent
    FROM (BoM2 LEFT JOIN BoM2 AS BoM2ndLvl ON BoM2.CPART = BoM2ndlvl.PPART) LEFT JOIN BoM2 AS BoM3rdlvl ON BoM2ndLvl.CPART = BoM3rdlvl.PPART;

    does the same
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

Posting Permissions

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