Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Doing SELECT, GROUP, ORDER on .DBF files ?

Posted on 1998-12-30
1
Medium Priority
?
222 Views
Last Modified: 2013-12-25
Hi,
i am using the following to open & access a .dbf file:
Set Db = Ws.OpenDatabase(App.Path,True,False,"dBASE IV")

To move the pointer, or do the next search:
Set Rs = Db.OpenRecordset("SELECT * FROM...WHERE...", dbOpenForwardOnly)

My Question:
The above selects line by line. If so, how can i do a GROUP, ORDER(ie.sort) on a selected list of results from a .DBF file ?? Or what would be the optimal way to do ?

Thanks for your advise,
Collin
0
Comment
Question by:collinng
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
vbWhiz earned 200 total points
ID: 1498610
To sort by a field simply add an 'ORDER BY' clause to the SELECT statement.

for ascending order
SELECT FROM... WHERE... ORDER BY tbl.fld;

for descending order
SELECT FROM... WHERE... ORDER BY tbl.fld DESC;

multiple fields to sort
SELECT FROM... WHERE... ORDER BY tbl.fld1, tbl.fld2 DESC, tbl.fld3;

So when you grab the first row it has already been sorted and is the first row in the sort order.


I hope this helps you out!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question