Select latest Address (1 Viewer)

cright99

Registered User.
Local time
Today, 22:03
Joined
Jan 17, 2009
Messages
24
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
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;
 

HiTechCoach

Well-known member
Local time
Today, 05:03
Joined
Mar 6, 2006
Messages
4,357
You could try using a sub query. See Subquery basics

Another option is to use a sub report.

Do you have a field to determine which record to select?
 
Last edited:

cright99

Registered User.
Local time
Today, 22:03
Joined
Jan 17, 2009
Messages
24
Thanks for that. Im trying to figure it out (im not to good at sql) But still havent got any where yet :(
 

ajetrumpet

Banned
Local time
Today, 05:03
Joined
Jun 22, 2007
Messages
5,638
I am willing to bet that if you upload the database, someone will fix it for you..
 

Users who are viewing this thread

Top Bottom