>I am now running your statement with the addition on PRICLIST however it gives me an error saying no PRICLIST field exists?... but this field does exists and is selected in your statement ...
>
> SELECT Crs_items.custcode, Crs_items.itemnumber, ;
> Rv_icpric.desc, rv_ARCUS.priclist, Rv_icpric.baseprice,Rv_icpric.baseunit ;
> FROM (SELECT Rv_uxdetail.custcode, Rv_uxdetail.itemnumber ;
> FROM rv_UXDETAIL ;
> GROUP BY Rv_uxdetail.custcode, Rv_uxdetail.itemnumber) ;
> Crs_items ;
> INNER JOIN rv_ARCUS ;
> ON Rv_arcus.idcust = Crs_items.custcode ;
> INNER JOIN rv_ICPRIC ;
> ON Rv_icpric.itemno = Crs_Items.itemnumber AND RV_icpric.pricelist = Crs_items.priclist ;
> INTO CURSOR crs_CurrentPrice
In the derived table crs_Items we don't have PricList field:
SELECT Rv_uxdetail.custcode, Rv_uxdetail.itemnumber ;
FROM rv_UXDETAIL ;
GROUP BY Rv_uxdetail.custcode, Rv_uxdetail.itemnumber
That's all what we have in that table.
May be you meant to also add max(PricList) as PricList in that table?
If it's not broken, fix it until it is.
My Blog