Ricardo Aráoz wrote:
> <snipped>
>> FROM eiwdb!lufab ;
>> LEFT JOIN ;
>> (SELECT r1.nlufabid, r1.nrate, r1.iid ;
>> FROM eiwdb!luFabRates r1 ;
>> INNER JOIN (select nlufabid,MAX(iid) as imax FROM
>> eiwdb!luFabRates r2 GROUP BY 1) x1 ;
>> ON x1.imax = r1.iid ;
>> WHERE r1.dactive <= DATE() ) r2 ;
>>
>
> Can it be you are missing an 'ON' condition here?
>
Winner!!!! I missed the ON part for joining r2 to lufab!! Here's the
successful code:
SELECT Lufab.iid, ;
Lufab.cdescription, ;
Lufab.nfactor, ;
Lufab.cqtytype, ;
Lufab.ctotalqtytype, ;
Lufab.cfactortype, ;
Lufab.cType, ;
Lufab.cClass, ;
luFab.cWorkcenter, ;
Lufab.dlastupdate, ;
lufab.cSKU1, ;
Lufab.lActive, ;
NVL(r2.nRate, 0000.00) as nRate;
FROM eiwdb!lufab ;
LEFT JOIN (SELECT r1.nlufabid, r1.nrate, r1.iid ;
FROM eiwdb!luFabRates r1 ;
INNER JOIN (select nlufabid,MAX(iid) as imax ;
FROM eiwdb!luFabRates r2
GROUP BY 1) x1 ;
ON x1.imax = r1.iid ;
WHERE r1.dactive <= DATE() ) r2 ;
ON r2.nlufabid = lufab.iid ;
ORDER BY Lufab.cdescription
Thanks, Ricardo!
--
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
"Work smarter, not harder, with MBSS custom software solutions!"
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.