A-B-C-D... links: Have two records in a field

Discussion in 'ASP General' started by Boolean, Jul 28, 2004.

  1. Boolean

    Boolean Guest

    Hi all.

    Im new to ASP, and have hit a snag.

    I am trying to build a page that has 'A-B-C-D...' links along the top
    of the page. When you click 'A', it goes to a table with everyones
    usernames and grabs the ones that start with the letter A.

    The problem is that the username field contains the names of people
    who wrote an article, so in some cases there are actually two names in
    this field. So for example, if it contained 'Bob, Jack', I would need
    'Bob' to show up under B, and 'Jack' under J.

    Im totally stuck as to how I might do this. Changing the layout of my
    tables is no trouble if a different table setup helps. Any thoughts?
    Boolean, Jul 28, 2004
    #1
    1. Advertising

  2. Boolean

    James Baker Guest

    If they're always going to be stored in that format, you can do a select
    statement with LIKE B% OR LIKE %, B% or something to that effect. Kind of a
    hokey way to do it, but it should work.

    "Boolean" <> wrote in message
    news:...
    > Hi all.
    >
    > Im new to ASP, and have hit a snag.
    >
    > I am trying to build a page that has 'A-B-C-D...' links along the top
    > of the page. When you click 'A', it goes to a table with everyones
    > usernames and grabs the ones that start with the letter A.
    >
    > The problem is that the username field contains the names of people
    > who wrote an article, so in some cases there are actually two names in
    > this field. So for example, if it contained 'Bob, Jack', I would need
    > 'Bob' to show up under B, and 'Jack' under J.
    >
    > Im totally stuck as to how I might do this. Changing the layout of my
    > tables is no trouble if a different table setup helps. Any thoughts?
    James Baker, Jul 28, 2004
    #2
    1. Advertising

  3. "Boolean" <> wrote in message
    news:...
    > Hi all.
    >
    > Im new to ASP, and have hit a snag.
    >
    > I am trying to build a page that has 'A-B-C-D...' links along the top
    > of the page. When you click 'A', it goes to a table with everyones
    > usernames and grabs the ones that start with the letter A.
    >
    > The problem is that the username field contains the names of people
    > who wrote an article, so in some cases there are actually two names in
    > this field. So for example, if it contained 'Bob, Jack', I would need
    > 'Bob' to show up under B, and 'Jack' under J.
    >
    > Im totally stuck as to how I might do this. Changing the layout of my
    > tables is no trouble if a different table setup helps. Any thoughts?


    Database? Version? DDL? Sample Data? Desired Output?
    http://aspfaq.com/etiquette.asp?id=5006

    Absent this information all I can offer is prose. You may want to consider
    creating an articles table with a one to many relationship to an authors
    table. Then create a stored procedure/parameterized query based on the
    authors table joined to the articles table passing in an last_initial
    parameter used to filter the data.
    Chris Hohmann, Jul 28, 2004
    #3
  4. Boolean

    Guest

    Function Help

    I wrote a function to check for a valid email...

    function IsEmailValid(email)
    dim sql
    sql = "usp_isemailvalid " & email
    set rs = conn.execute(sql)
    if rs.eof then
    IsEmailValid = false
    else
    IsEmailValid = true
    end if
    end function

    how can I use that function in an if statement ??

    if IsEmailValid(email) = true then
    response.write("success!")
    else
    response.write("fraid not!")
    end if
    , Jul 28, 2004
    #4
  5. Boolean

    dlbjr Guest

    Re: Function Help

    if IsEmailValid(email) then
    response.write("success!")
    else
    response.write("fraid not!")
    end if


    dlbjr
    Pleading sagacious indoctrination!
    dlbjr, Jul 28, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke Airig
    Replies:
    0
    Views:
    786
    Luke Airig
    Dec 31, 2003
  2. Dan

    Delete records or update records

    Dan, May 10, 2004, in forum: ASP General
    Replies:
    1
    Views:
    460
    Ray at
    May 10, 2004
  3. Replies:
    3
    Views:
    653
    Anthony Jones
    Nov 2, 2006
  4. Sound
    Replies:
    2
    Views:
    437
    Randy Webb
    Sep 28, 2006
  5. jr
    Replies:
    3
    Views:
    415
Loading...

Share This Page