evanscamman
Registered User.
- Local time
- Today, 01:09
- Joined
- Feb 25, 2007
- Messages
- 274
I have two tables in a one to many relationship - tblOrder and tblOrderStatus.
How can I create a query that returns each record in tblOrder and only the last matching record per order from tblOrderStatus?
I've tried using a subquery for tblOrderStatus - with a TOP of 1 -
but this only returns the very last record in the table - not the last for each order.
I've also tried the first and last aggregate functions, but they don't seem to do anything.
I wouldn't have thought that this could be so hard - any ideas?
I could do a dlookup in the query, but that is sooooo slow....
Thank you!
Evan
How can I create a query that returns each record in tblOrder and only the last matching record per order from tblOrderStatus?
I've tried using a subquery for tblOrderStatus - with a TOP of 1 -
but this only returns the very last record in the table - not the last for each order.
I've also tried the first and last aggregate functions, but they don't seem to do anything.
I wouldn't have thought that this could be so hard - any ideas?
I could do a dlookup in the query, but that is sooooo slow....
Thank you!
Evan