kam <> wrote:
> I have records with a date field: dDateServ  D (I am displaying a
> string but the date field is a type 'date') 
> 
> 1. 02/15/2006
> 2. 03/15/2006
> 3. 04/15/2006
> 4. 05/15/2006
> 5. 06/15/2006
> 6. 07/15/2006
> 7. 08/15/2006
> 8. 09/15/2006
> 
> I want a LOCATE statement something like this:
> 
> LOCATE FOR dDateServ  <= date(2006,06,18)
> 
> I want record #5 - the max date that satisfies the for clause.

You said SQL so I'll give that answer:
Select top 1 dDateServ 
from yourTable
Where dDateServ <= ?lDate
Order by 1 desc




Stephen Russell
DBA / .Net Developer

Memphis TN 38115
901.246-0159

"Our scientific power has outrun our spiritual power. We have guided
missiles and misguided men." Dr. Martin Luther King Jr.

http://spaces.msn.com/members/srussell/

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.4/475 - Release Date: 10/13/2006
 



_______________________________________________
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
** 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