>>I am trying to make your suggestion to work. Is there missing INTO ORDERTABLE in the Select which is within the parantheses? Because you have two names YOURTABLE and ORDERTABLE.
>>
>>Thank you.
>
>Sorry, changed my mind about what to call your table.
>
>
>select KEYFIELD, CUST_ID as CUSTOMER, ORD_DATE, ORD_TIME ;
>from ORDERTABLE ;
>where KEYFIELD in ;
>(select top 1 KEYFIELD from ORDERTABLE
>where CUST_ID == CUSTOMER
>order by ORD_DATE, ORD_TIME descending)
>order by CUSTOMER
>
>
>I'm assuming that you have a unique primary key in your order record.
>
>Peter
Yes, the table has a unique PK. But I am getting error "Command is missing required clause" and it seems to point to the (Select top 1...). I will keep trying to see if maybe I made a mistake in creating a real SQL Select.
Again, thank you so much.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham