>>>>>Thank you William.
>>>>>
>>>>BTW, there are other ways to get the same information, but this one is the simplest to remember.
>>>
>>>"Simplest" is very subjective and depends upon how one "grew up" with SQL. I think the pre-VFP9 version
>>>SELECT * FROM Table2 WHERE date IN (SELECT MAX(Date) AS Date FROM Table1)
is simpler to remember. I will accept that the more "modern" code is "better" and may run faster, etc. but simpler, like beauty, is in the eye of the beholder.
>>
>>The code above is not correct.
>>
>>When I was coming home I was thinking I should write a FAQ on this topic since it's a commonly asked question. I thought it through, but I don't think if I can find the time to actually do this.
>
>
"The code above is not correct.">
>How so? I get the same results as Borrislav using the sample data provided. Could you show me conditions where the results will differ?
I meant here, that for date fields you usually don't use IN syntax, you use DATE = (...) Other than that, it's fine.
If it's not broken, fix it until it is.
My Blog