On Thu, March 12, 2009 3:09 pm, Stephen Russell wrote: > On Thu, Mar 12, 2009 at 1:58 PM, KAM.covad > <[email protected]> wrote: > >> I have a table with a date field: dDate and thousands of records. >> >> >> The dates are scattered over time including the future. I need to find >> the record with the max date that is =< required date. >> >> How would you do this with sql select and also with Locate? >> > ------------------------ > > > Select top 1 <column list> > from yourTable where dDate <= ldDate order by dDate descending > > For Fox 7 and higher I believe, maybe you need 8??
Not sure, but I'm pretty sure TOP 1 was in VFP 5/6? That's pretty basic. _______________________________________________ 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.

