# Thread: more problems with odbc

1. Registered User
Join Date
Oct 2002
Location
Leicester - UK
Posts
820

## 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.

2. Registered User
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

#### Posting Permissions

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