Reputation: 103
I am writing SQL statements in Access 2010 for my homework. What I am trying to do is Display the Client Number, Client Name, Bookkeeper Number, First Name, and Last Name for
all clients. Sort the records in ascending order by bookkeeper number and client number
. That is what the question is asking me. But when i go to write the statement, I am receiving an error saying that the bookkeeper number could refer to more than one table in the from clause. How could I get around this?
This is what I tried so far
select C.[client number], C.[client name], C.[bookkeeper number], B.[firstname]
from [client] C, [bookkeeper] B
order by [bookkeeper number], [client number] ASC;
Upvotes: 0
Views: 157
Reputation: 11883
To solve the error, just add a B.
in the order by
like this: B.[bookkeeper number]
.
However to get the correct results you will also have to add a INNER JOIN clause between the two tables.
Upvotes: 2