Basically, I am struggling again, so I need some quick speedy replies if possible. I have cut this down to basics, I am after something simple.
I have a table that returns a list of Enquiries, I basically need the 'postings' table which is a list of changes to that enquiry to show the last entry when I do a 'select' search.
Table sos_enquiries
Enquiry ID, Manager, Date of Enquiry, Customer and hopefully two generated field LastPosted with the Message.
SELECT EnquiryID, Manager, DateOfEnquiry, Customer
FROM sos_enquiry
Example data
1002,DR,1/1/2008, "The Customer"
1003,JA,12/12/2007, "Another Customer"
Table sos_postings
PostingID, EnquiryID, PostingDate and Message
SELECT PostingID, EnquiryID, PostingDate, Message
FROM sos_posting
Example data
1,1002,2/1/2008 12:32, "The Job is going fine"
2,1002,1/1/2008 10:22, "Just Started the job"
The output should be :-
EnquiryID, Manager, DateOfEnquiry, Customer, LastPosted,LastMessage
1002,DR,1/1/2008,"The Customer",2/1/2008 12:32, "The Job is going fine"
Thank you, I know its simple but spent too much time on it so far.
Start Free Trial