Results 1 to 4 of 4

Thread: Sorting / Filtering

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    Rijswijk, Holland
    Posts
    25

    Post

    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.

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Posts
    232

    Post

    Sorting
    TempStr = "select * from MyTable order by Field1"
    Filtering
    TempStr = "select * from MyTable where Field1 like 'str*'"


    ------------------
    smalig
    [email protected]
    smalig.tripod.com

  3. #3
    Junior Member
    Join Date
    Oct 1999
    Posts
    31

    Post

    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!!!

  4. #4
    Addicted Member
    Join Date
    Oct 1999
    Posts
    232

    Post

    In ms access LIKE 'A%' not working.

    ------------------
    smalig
    [email protected]
    smalig.tripod.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width