home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / database / 9279 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.2 KB  |  33 lines

  1. Newsgroups: comp.databases
  2. From: davec@wsti.demon.co.uk (David Churcher)
  3. Path: sparky!uunet!pipex!demon!wsti.demon.co.uk!davec
  4. Subject: Re: Foxpro: Reporting/Querying on most recent date in DBF 
  5. Distribution: world
  6. References: <C131HG.4C4@acsu.buffalo.edu>
  7. Organization: Welcom Software Technology International
  8. Reply-To: davec@wsti.demon.co.uk
  9. X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.18)
  10. Lines: 18
  11. Date: Thu, 21 Jan 1993 17:36:03 +0000
  12. Message-ID: <727655170snz@wsti.demon.co.uk>
  13. Sender: usenet@demon.co.uk
  14.  
  15. In article <C131HG.4C4@acsu.buffalo.edu> v125qmam@ubvmsb.cc.buffalo.edu writes:
  16.  
  17. >Hi all!
  18. >        How can I get Foxpro to point to the record containing the most
  19. >        recent date within a group?  For example: 
  20. >
  21. >        The File looks like this:
  22. >
  23. >                        Name    C       20
  24. >                        Date    D        8
  25. >
  26. >        I want to query the most recent Date associated with a given name.
  27. >        The MAX Function requires a list of possibilites...
  28.  
  29.  SELECT FROM yourdbf MAX(Date) WHERE Name="theNameYouWant" INTO ARRAY target
  30.  
  31.  with an index tag on Name, will do it, although it will scan each
  32. record with the name you requested to find the maximum date.
  33.