Finding last comment

bibbyd01

Registered User.
Local time
Today, 01:10
Joined
Apr 8, 2009
Messages
47
Hi All

I have a form which I would like to display the last comment made against a particular order.

I have a datasheet form (frm_orderdetails) which has continuous records, based on the order number. You can also add comments to a table (tbl_comments), which includes the date and time of entering this in. On the form, I want it to display the last comment made based on the date and time.

I have therefore created a query for the date, set as max with no duplicates, and the same for time, before combining them on one query with the other order details. This has, predictably not worked as expected, and all it's doing is listing each order with the same max date and time.

So, how the hell do I do this?
 
Max is a field level operative within the grouping which may be the whole file, it is normal to require to queries to achieve the desired results

Q1 Groupby the I'd in your case I think that is the order and max on the date/time,

Q2 joins this query on all its fields back to the table to retrieve any other data required

Brian
 

Users who are viewing this thread

Back
Top Bottom