I have an inventory cycle count file which may contain several thousand records. I am trying to get the TOP 20 items (based on qty_adjusted value) and return only those to a dataset.

I am trying to use the TOP 20 statement but am getting an Invalid Token error at execution time.


SELECT TOP 20 di3.Qty_A00001 +
FROM Dobsojm1.Item_00003 di3 +
JOIN Dobsojm1.ITEM_00001 di1 +
ON di3.ITEM_00001 = di1.ITEM_00001 +
ORDER BY di3.Qty_A00001 DESC"

Also tried


SELECT * +
FROM Dobsojm1.Item_00003 di3 +
JOIN Dobsojm1.ITEM_00001 di1 +
ON di3.ITEM_00001 = di1.ITEM_00001 +
ORDER BY di3.Qty_A00001 DESC LIMIT 20"

Neither works... Where am I going wrong here.... Oh .... also there may be duplicated "high" adjustments so I need to figure those into the top 20.

thank you

gollnick