SELECT 'V' , Voucher_No, Voucher_Prefix, 'ItemwisePurchaseOrder',  Voucher_Date as 'Voucher Date', Voucher_No as 'Voucher No',( SELECT Item_Name from $master_db.Sales_Inventory_Items si WHERE si.Item_Id= soi.Item_ID) as 'Item ',Qty_Total as 'Total Quantity',(SELECT Name From $master_db.Employee_Details ed WHERE ed._id = soi.Salesman_ID) as 'Salesman',Total_Amount as 'Total Amount' FROM $trans_db.Purchase_Order_Itemwise soi  WHERE Voucher_Date>=str_to_date('$fromDateTime','%Y-%m-%d %H:%i:%s') AND Voucher_Date<=str_to_date('$toDateTime','%Y-%m-%d %H:%i:%s')