SELECT 'I' as Ind, sales_item as Item_ID, (SELECT Item_Name FROM Sales_Inventory_Items where Item_ID = sales_item) AS 'Sales Item', sales_item_qty AS 'Sales Qty', Cast(purchase_item_qty AS Decimal(10,2)) AS 'Purchase Qty'  FROM ingredients WHERE purchase_item = '$f1' UNION SELECT 'I' as Ind, Item_ID,  ITEM_NAME, 1,1 FROM Sales_Inventory_Items Where Item_id = '$f1' and isSalesItem = 1