I'm trying to retrieve data from the most recent treatment, and I'd like to
try and do it in one select statement.

This works with two, how to combine?

SELECT comp_no, MAX(date_serv) as maxdate FROM health WHERE comp_no =
thisform.r_comp GROUP BY comp_no INTO CURSOR temp


SELECT health.comp_no, health.item_no, health.descript FROM health WHERE
comp_no = thisform.r_comp AND date_serv = temp.maxdate








James E Harvey
Hanover Shoe Farms, Inc.
M.I.S./Corresponding Officer
Off: 717-637-8931
fax: 717-637-6766
email: [EMAIL PROTECTED]




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to