Results 1 to 2 of 2

Thread: DataEnvironment / Parameter Query Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Edgerton, WI
    Posts
    381
    In one of my projects I can click on a button and execute a parameter query in the dataenvironment against the LastName field of my database. The parameter is passed from the user input into a input box. I thought everything was working fine. It returns the expected results as long as I enter the name exactly.

    However, I get no results if the last name is incomplete. What I want to do is be able to enter something like "bu" and have it return all records that have "bu" in the last name, such as burns, Burns, buttonwood, burnside, burg, butler, etc. The code I am currently using is listed below.

    SELECT ContactDate, FirstName, LastName, Address, City, Country,
    `Contact Type`, `Denominatinal Background`, EmailName,
    PostalCode, StateOrProvince, WorkPhone, `Brief Note`,
    Notes
    FROM `General Conference Contacts`
    WHERE (LastName = ?)
    ORDER BY ContactDate

    Any help here will be most appreciated.

    Thanks,
    Rev. Michael L. Burns

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    try :

    SELECT ContactDate, FirstName, LastName, Address, City, Country,
    `Contact Type`, `Denominatinal Background`, EmailName,
    PostalCode, StateOrProvince, WorkPhone, `Brief Note`,
    Notes
    FROM `General Conference Contacts`
    WHERE (LastName like ? )
    ORDER BY ContactDate

    Note: you'll want to append "*" (or "%", depending on the dbms) to the end of the data that represents the input parm. That, or make the user do it.

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