SELECT
	o.record_number
	,o.Order_Number
	,CONCAT(cust.Last_Name, ', ', cust.First_Name) AS Customer_Acct
	,o.Product_Total
	,o.Tax_Total
	,o.Savings_Total
	,o.Grand_Total
	,o.Order_Date
	,pmt.Name AS Payment_Method
	,o.Bill_First_Name
	,o.Bill_Last_Name
	,o.Bill_Company
	,o.Bill_Street
	,o.Bill_Street_2
	,o.Bill_City
	,s.Name AS Bill_State_or_Province
	,o.Bill_Postal_Code
	,c.Name AS Bill_Country
	,o.Bill_Email_Address
	,o.Bill_Phone
	,o.Bill_Fax


	,o.Ship_First_Name
	,o.Ship_Last_Name
	,o.Ship_Company
	,o.Ship_Street
	,o.Ship_Street_2
	,o.Ship_City
	,s2.Name AS Ship_State_or_Province
	,o.Ship_Postal_Code
	,c2.Name AS Ship_Country
	,o.Ship_Email_Address
	,o.Ship_Phone
	,o.Ship_Fax
	,o.Ship_Address_Is
	,o.Ship_Special_Instructions
	,o.Shipping_Details
	,o.Packing_Details

	,o.IP_Address
	,o.User_Agent
	,o.Host_Name
	,o.Referring_URL
	,o.Referral_Date

FROM
	Orders o

LEFT JOIN
	Customers cust
ON
	o.Ordered_By = cust.record_number


LEFT JOIN
	Payment_Methods pmt
ON
	o.Payment_Method = pmt.record_number

LEFT JOIN
	States s
ON
	o.Bill_State_or_Province = s.record_number

LEFT JOIN
	States s2
ON
	o.Ship_State_or_Province = s2.record_number

LEFT JOIN
	Countries c
ON
	o.Bill_Country = c.record_number

LEFT JOIN
	Countries c2
ON
	o.Ship_Country = c2.record_number