Im trying to create an invoice but if there is more than one address. Then it keeps on creating more than one Account information. For example more than one quantity, description and unitprice. Ive tried to use MAX on AccountID but this dosn't seem to work. Any ideas?
Here is my SQL
Here is my SQL
SELECT Account.AccountID, Account.AmountOwed, Account.DateEntered, Account.PaymentType, AccountDes.Quantity, AccountDes.Description, AccountDes.UnitPrice, [quantity]*[unitprice] AS Amount, [Client Details].CustomerID, [Client Details].Surname, [Client Details].[Given Name 1], Address.Number, Address.Street, Address.Suburb, Address.City, Address.Country, Address.AddressID
FROM ([Client Details] LEFT JOIN Address ON [Client Details].CustomerID = Address.[Customer ID]) INNER JOIN (Account INNER JOIN AccountDes ON Account.AccountID = AccountDes.AccountID) ON [Client Details].CustomerID = Account.CustomerID;