You are here:

FoxPro/How to use max() in a query

Advertisement


jjazzbel wrote at 2014-04-01 00:00:50
It may be easier to simply use a subquery...  Depending on what you need to match on you can also include a.card_no = b.card_no in the subquery.





select  a.dexpiry, a.custId, a.card_no ;

from customer a ;

where a.dexpiry in (select max(b.dexpiry) from customer b ;

   where a.cust.id = b.cust_id) ;

INTO CURSOR csrCustomer




FoxPro

All Answers


Answers by Expert:


Ask Experts

Volunteer


Carla Fair-Wright

Expertise

I can answer most general questions regarding Visual FoxPro. I am also very good with WSH, WMI,and FSO scripting and most internet technologies. I like to answer questions. To me there is no such thing as a dumb question. Don't be afraid to ask me anything about FoxPro or Visual FoxPro. I will try to answer all questions as quickly as I can. It may take me a day or longer for a complex error or one that is hard to reproduce. Please include the version of FoxPro you are using.

Experience

My professional experience with computer programming started in my early twenties, I went back to college with thoughts of finishing an engineering degree and ended up in computer science.
I have used Oracle, SQL Server, Access, and FoxPro.

Experience in the area
I have been using the product for over 10 years. I am a MCP in Visual FoxPro (Desktop). I am ASQ Certified in Software Quality Engineering

Publications

Books
Chapter Author, Case Studies and Applications of Web Based Energy Information and Control Systems (Fairmont Press), June 2005

Chapter Author, Encyclopedia of Energy Engineering and Technology 1st Edition, (Francis Books) Spring 2006

Magazines
Component Developer Magazine
Maintenance Technology


Education/Credentials
BS - Computer Science
AS - Management Information Science
AS - Technical Management
AS - Electronic Systems Technology

Organizations

Member of Society of Women Engineers (SWE)
Member of American Society for Quality (ASQ)

©2016 About.com. All rights reserved.