>oooOOOHHH. ok i am a little confused. I dont need to take all the salesman table. let's say i have the id of the salemen. what the sql should look like
Same SQL, just add a where clause for the salesman
where SalesmanID = 1243 (our number).
Yes, unfortunately this SQL is a bit tricky to get the amount for the last invoice.
It would be easier in latest versions of SQL Server.
If it's not broken, fix it until it is.
My Blog