Im new to using SQL in FP and Im trying to transfer the following sql from ms query:
SELECT Max(po.po) as [PO], po.venname as [Vendor], po.podate_ord as [Date_Ordered], stock.stawg as [Ga], stock.stwiretype as [Description], po.pounitcost as [Unit_Cost], po.pounits as [Units], stock.stftperlb as [Ft_per_Lb], po.pounstnum as [Item_Number]
FROM po po inner join stock on po.pounstnum= stock.stitemnum
WHERE (po.pounitcost>0) AND (po.pounstnum Is Not Null) AND (po.pounstnum <>""
Group By po.pounstnum
ORDER BY po.pounstnum
However I can only get as close as:
SELECT MAX(PO.PO) AS [PO], PO.VENNAME AS [VENDOR], PO.PODATE_ORD AS [DATE_ORDERED], STOCK.STAWG as ,;
STOCK.STWIRETYPE, PO.POUNITCOST, PO.POUNITS, PO.POUNSTNUM;
FROM PO, STOCK;
WHERE PO.POUNSTNUM == STOCK.STITEMNUM;
AND (PO.POUNITCOST > 0;
AND PO.POUNSTNUM <> ""
;
GROUP BY PO.POUNSTNUM;
ORDER BY PO.POUNSTNUM
So my question is, how can I, if at all, acheive my inner join?
I've also noticed the use of cursors in some of the posts. Where can I find more specific info on usiing cursors in 2.6?
Any and all advice is greatly apreciated.
Thanks,
John
SELECT Max(po.po) as [PO], po.venname as [Vendor], po.podate_ord as [Date_Ordered], stock.stawg as [Ga], stock.stwiretype as [Description], po.pounitcost as [Unit_Cost], po.pounits as [Units], stock.stftperlb as [Ft_per_Lb], po.pounstnum as [Item_Number]
FROM po po inner join stock on po.pounstnum= stock.stitemnum
WHERE (po.pounitcost>0) AND (po.pounstnum Is Not Null) AND (po.pounstnum <>""
Group By po.pounstnum
ORDER BY po.pounstnum
However I can only get as close as:
SELECT MAX(PO.PO) AS [PO], PO.VENNAME AS [VENDOR], PO.PODATE_ORD AS [DATE_ORDERED], STOCK.STAWG as ,;
STOCK.STWIRETYPE, PO.POUNITCOST, PO.POUNITS, PO.POUNSTNUM;
FROM PO, STOCK;
WHERE PO.POUNSTNUM == STOCK.STITEMNUM;
AND (PO.POUNITCOST > 0;
AND PO.POUNSTNUM <> ""
GROUP BY PO.POUNSTNUM;
ORDER BY PO.POUNSTNUM
So my question is, how can I, if at all, acheive my inner join?
I've also noticed the use of cursors in some of the posts. Where can I find more specific info on usiing cursors in 2.6?
Any and all advice is greatly apreciated.
Thanks,
John