PDA

Click to See Complete Forum and Search --> : Sorting / Filtering


ingrid
Nov 1st, 1999, 08:06 PM
In my program I wrote the next sentences:

Set NewWS = DBEngine.Workspaces(0)
Set NewDB = NewWS.OpenDatabase(MY.MDB)
TempStr = "select * from MyTable"
Set NewDyn = NewDb.OpenRecordset(TempStr)

How can I sort on one or two fields?
How can I filter some information from a field?

I hope you will give an answere.

Greetings,

Ingrid.

smalig
Nov 1st, 1999, 08:12 PM
Sorting
TempStr = "select * from MyTable order by Field1"
Filtering
TempStr = "select * from MyTable where Field1 like 'str*'"


------------------
smalig
smalig@hotmail.com
smalig.tripod.com (http://smalig.tripod.com)

Ghost
Nov 1st, 1999, 08:13 PM
You can user WHERE clause to filter data and ORDER BY to sort data in your SQL statement. Let's say: you want to get the list of all employees from EMPLOYEE whose name starts with A. Your SQL statement will look like:

SELECT * FROM EMPLOYEE
WHERE EMP_NAM LIKE 'A%'
ORDER BY EMP_NAM

HTH!!!

smalig
Nov 1st, 1999, 08:30 PM
In ms access LIKE 'A%' not working.

------------------
smalig
smalig@hotmail.com
smalig.tripod.com (http://smalig.tripod.com)