Sql = " select header.PURCHASEORDERNUMBER as PONUM, header.REQUESTID, lineitems.LINEID, lineitems.GLACCOUNT," Sql = Sql & " header.groupid ,header.FACILITYCODE as facility, header.DEPARTMENTNUMBER as dept, " Sql = Sql & " header.HEATTICKET as heatnum, organization.ORGANIZATIONNAME as EmployeeRequest_ORG," Sql = Sql & " employees.FIRSTNAME as EmployeeRequest_First, employees.LASTNAME as EmployeeRequest_Last, " Sql = Sql & " header.TERMS payment_Terms," Sql = Sql & " SHIPPING.description as SHIPTO_method, lineitems.SHIPTO SHIPTO_NAME, " Sql = Sql & " lineitems.SHIPADDRESS1 as SHIPTO_ADDRESS1," Sql = Sql & " lineitems.SHIPADDRESS2 as SHIPTO_ADDRESS2, lineitems.SHIPCITY as SHIPTO_CITY," Sql = Sql & " lineitems.SHIPSTATE as SHIPTO_STATE, lineitems.SHIPZIPCODE as SHIPTO_ZIP,lineitems.supplierid, " Sql = Sql & " suppliers.COMPANYNAME supplier_company,suppliercontacts.FIRSTNAME supplier_FIRST," Sql = Sql & " suppliercontacts.LASTNAME as supplier_last,suppliercontacts.FAXNUMBER as supplier_fax," Sql = Sql & " supplieraccounts.ACCOUNT as supplier_accountnum,products.MANUFACTURER as product_manufacturer," Sql = Sql & " lineitems.ORDERDATE as product_Orderdate, " Sql = Sql & " products.PARTNUMBER as product_partnum, products.UNITOFMEASURE as product_unitomeasure," Sql = Sql & " lineitems.UNITPRICE as product_Unitprice," Sql = Sql & " lineitems.UNITDISCOUNT as product_Unitdiscount," Sql = Sql & " (lineitems.UNITPRICE - lineitems.UNITDISCOUNT) as product_Disc_PPUnit," Sql = Sql & " lineitems.UNITSORDERED as product_UnitsOrdered, lineitems.UNITSHIPPINGCOST as product_unitshipping," Sql = Sql & " (lineitems.UNITSHIPPINGCOST * lineitems.UNITSORDERED) as product_Shipping_TOTAL, " Sql = Sql & " ((lineitems.UNITPRICE - lineitems.UNITDISCOUNT) * lineitems.UNITSORDERED) as product_ItemCost_TOTAL," Sql = Sql & " products.description as Product_PrimaryDescription, alt_linedescription.DESCRIPTION as Product_Altdescription," Sql = Sql & " group_info.ATTENTION as group_attention, group_info.ADDRESS as group_address1," Sql = Sql & " group_info.ADDRESS2 as group_address2," Sql = Sql & " group_info.CITY as group_city, group_info.STATE as group_state, group_info.ZIP as group_zip, " Sql = Sql & " users.USERNAME as Creator_NAME, users.EMAIL as creator_Email, users.PHONENUMBER as creator_PHONE, " Sql = Sql & " users.EXTENSION as creator_PHONE_EXT, users.FAXNUMBER as creator_FAX, " Sql = Sql & " concat(lineitems.SUPPLIERID, lineitems.SUPPLIERCONTACTID) as grouping " Sql = Sql & " from header,lineitems, suppliers, suppliercontacts,supplieraccounts," Sql = Sql & " products, alt_linedescription, group_info, users, employees, shipping, organization" Sql = Sql & " where header.REQUESTID=lineitems.REQUESTID and " Sql = Sql & " lineitems.SUPPLIERID=suppliers.SUPPLIERID and" Sql = Sql & " lineitems.SUPPLIERCONTACTID=suppliercontacts.contactid (+) and " Sql = Sql & " suppliers.SUPPLIERID=supplieraccounts.SUPPLIERID (+) and " Sql = Sql & " lineitems.PRODUCTID=products.PRODUCTID (+) and " Sql = Sql & " lineitems.LINEID=alt_linedescription.LINEID (+) and " Sql = Sql & " suppliers.SUPPLIERID=supplieraccounts.SUPPLIERID (+) and" Sql = Sql & " header.UPDATEDBY=users.USERID (+) and " Sql = Sql & " header.GROUPID=group_info.GROUPID (+) and " Sql = Sql & " header.EMPLOYEEID=employees.EMPLOYEEID (+) and " Sql = Sql & " lineitems.SHIPPINGMETHOD=shipping.SHIPPINGID(+) and " Sql = Sql & " header.OrganizationCode = Organization.OrganizationCode and " Sql = Sql & " header.GROUPID=1 and" Sql = Sql & " header.REQUESTID=33 " Sql = Sql & " order by lineitems.LINEID"