SELECT DISTINCT fg.FyerOrg_id client_id, fg.`ID` fyer_grp_id, fg.FyerGovtLease gov_lease, fg.FyerSaveName save_name, fg.FyerYear year, fg.FyerProposedVendor, twf.`ID` fyer_rec_id, twf.`ID#` twf_id_num, twf.Install, twf.SerialNum, twf.Features, twf.present_type_id, twf.proposed_model_id, twf.present_room_number, twf.`Annual Volume` annual_vol, twf.BidMeter, twf.MoveTo, twf.MoveFrom, twf.PropVol, twf.VendorName, twf.AdjCostCopy, twf.NewSerialNum, twf.NewVendorID, "need this" VerDate, twf.present_type_id cpc_type, twf.Color_Vol col_vol, twf.Color_CPC col_cpc, twf.Color_Vol * twf.Color_CPC col_cost, twf.NewColorCPC, twf.ProjColorVol, twf.IP_Address, "need this" old_IP_Address, twf.Special_Notes, twf.mac_address, twf.map_id, twf.present_model_id, "need this" under_contract, twf.present_floorplan_id, "need this" proposed_floorplan_id, twf.GroupTag, twf.PropCost, twf.PropVol prop_100_pct_vol, twf.PropVol / 10 month_vol, twf.PropVol * twf.PropCost bill_month_100, (twf.PropVol * twf.PropCost) * 0.8 bill_12_month_80, ((twf.PropVol * twf.PropCost) * 0.8)/10 pct_80_of_month, pres_mach.intro, pres_mach.life, pres_mach.is_color is_color, pres_mach.max_speed speed, prop_mach.life prop_life, prop_mach.intro prop_intro, loc_dept.dept_name, loc_bldgs.building_name, loc_bldgs.StudentPop, loc_bldgs.BldgEquipCost, loc_org.Equip annual_cost, loc_org.LastUpdate upgrade_dt, loc_org.LastUpdate bid_dt, loc_org.survey_date, loc_org.org_name client_name, loc_org.address, "need this" city_state_zip, twf.`1stYearEquipment` first_yr_equip, twf.`2ndYear` yr_2, twf.`2ndYear` yr_3, twf.`2ndYear` yr_4, twf.`2ndYear` yr_5, twf.`S&&S` ss, loc_mach_types.id, loc_mach_types.type_name, concat(pres_mach.make, " ", pres_mach.model) pres_model, concat(tbc.`First Name`, " ", tbc.`Last Name`) contact #INTO FYER_Report_pg01 FROM FYER_Group fg LEFT JOIN tblWhatif twf ON twf.save_name_id = fg.`ID` LEFT JOIN machines prop_mach ON prop_mach.id = twf.proposed_model_id LEFT JOIN machines pres_mach ON pres_mach.id = twf.present_model_id INNER JOIN organization loc_org ON loc_org.id = fg.FyerOrg_id INNER JOIN tblContacts tbc ON tbc.org_id_contact = loc_org.id LEFT JOIN buildings loc_bldgs ON loc_bldgs.id = twf.building_id LEFT JOIN machine_types loc_mach_types ON loc_mach_types.id = pres_mach.model_type #INNER JOIN FYER_Rpt_Client_Info clients ON clients.id = fg.FyerOrg_id LEFT JOIN department loc_dept ON loc_dept.id = twf.dept_id WHERE fg.`ID` = 1667 ORDER BY twf.`ID#`;