Results 1 to 2 of 2

Thread: SQL parameter

  1. #1
    New Lounger
    Join Date
    Apr 2001
    Location
    Dacula, GA, USA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL parameter

    I have a single table of names and addresses. I would like to use the SQL parameter code to return all the addresses for a given street. Something like this works manually.
    SELECT resident.name, resident.address
    FROM resident
    WHERE (((Resident.address)Like "*Oak CT"));

    This returns all numbered addresses on Oak CT. If I use the parameter code:

    PARAMETERS [Street to summarize:] Text;
    SELECT Resident.Name, Resident.Address
    FROM Resident
    Where (((Resident.Address)Like "*[Street to summarize:]"));

    This code returns about 8/13 of the names in the database, not just the street addresses for say Oak CT.

    What am I missing? Of course the database is Resident and the columns are name and address

  2. #2
    New Lounger
    Join Date
    Apr 2001
    Location
    Dacula, GA, USA
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL parameter

    Oops, I figured it out.

    PARAMETERS [Street to summarize:] Text;
    SELECT Resident.Name, Resident.Address
    FROM Resident
    WHERE (((Resident.Address)like [Street to summarize:]));

    When prompted, enter the wildcard character with the street name, i.e. *Oak CT or *Cedar ST.

Posting Permissions

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