Hello, I'm using a modified invoice report from the sample invoice.mdb that comes with access 2002, If my order dosen't have any Product (only labor,) then my report cancel. how can I get it to print regardless os products or not. Please look at my joins cause I think thats where the problems is.
SELECT Orders.*, [Order Details].OrderDetailID, [Order Details].ProductID, [Order Details].Quantity, [Order Details].UnitPrice, [Order Details].Discount, Customers.CompanyName, Customers.ContactFirstName, Customers.ContactLastName, Customers.BillingAddress, Customers.City, Customers.StateOrProvince, Customers.PostalCode, Customers.[Country/Region], Customers.PhoneNumber, Customers.ContactFirstName & " " & Customers.ContactLastName AS [Contact Name], Products.ProductName, CLng(([Quantity]*[order details].UnitPrice)*([Discount])*100)/100 AS Htotal, ([NoStaff]*[Hrs]*[StaffRate])+([NoStaff]*[Whrs]*[WstaffRate]) AS ltotal, (CLng([Quantity]*[order details].UnitPrice*(1-[Discount])*100)/100) AS ptotal, CLng(([Quantity]*[order details].UnitPrice)*(1+[Discount])*100)/100 AS [Line Total], [Order Details].notes
FROM Products INNER JOIN ((Customers RIGHT JOIN (Employees RIGHT JOIN Orders ON Employees.EmployeeID = Orders.EmployeeID) ON Customers.CustomerID = Orders.CustomerID) RIGHT JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID) ON Products.ProductID = [Order Details].ProductID;
SELECT Orders.*, [Order Details].OrderDetailID, [Order Details].ProductID, [Order Details].Quantity, [Order Details].UnitPrice, [Order Details].Discount, Customers.CompanyName, Customers.ContactFirstName, Customers.ContactLastName, Customers.BillingAddress, Customers.City, Customers.StateOrProvince, Customers.PostalCode, Customers.[Country/Region], Customers.PhoneNumber, Customers.ContactFirstName & " " & Customers.ContactLastName AS [Contact Name], Products.ProductName, CLng(([Quantity]*[order details].UnitPrice)*([Discount])*100)/100 AS Htotal, ([NoStaff]*[Hrs]*[StaffRate])+([NoStaff]*[Whrs]*[WstaffRate]) AS ltotal, (CLng([Quantity]*[order details].UnitPrice*(1-[Discount])*100)/100) AS ptotal, CLng(([Quantity]*[order details].UnitPrice)*(1+[Discount])*100)/100 AS [Line Total], [Order Details].notes
FROM Products INNER JOIN ((Customers RIGHT JOIN (Employees RIGHT JOIN Orders ON Employees.EmployeeID = Orders.EmployeeID) ON Customers.CustomerID = Orders.CustomerID) RIGHT JOIN [Order Details] ON Orders.OrderID = [Order Details].OrderID) ON Products.ProductID = [Order Details].ProductID;