>SELECT * FROM temp1 ; > INTO CURSOR temp2 ; > WHERE STR(con_id) + DTOS(plan_end_date) IN ; > (SELECT STR(con_id) + DTOS(MAX(plan_end_date)) ; > FROM temp1 ORDER BY con_id ; GROUP BY con_id) >>The code above is run on a cursor (temp1) that is a join of a parent and child table where the PK of the parent (con_id) = the FK of the child (plan_con_id). Both fields con_id and plan_con_id are in cursor temp1. Temp1 looks like this:
>con_id con_lname con_fname plan_con_id plan_end_date >123 smith john 123 01/01/2002 >123 smith john 123 01/01/2001 >etc. >>When I run the above using plan_con_id (the FK) instead of con_id (replace each instance of con_id), no records are returned. When I switch to con_id, it runs correctly and returns one record with the latest date and associated consumer fields. Since the values are the same for con_id and plan_con_id, why would it make a difference using one over the other?