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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Boolean

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

    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

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

    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" <thecoconutmonk ey@hotmail.com> wrote in message
    news:85e18f4e.0 407280630.7d73f 60f@posting.goo gle.com...[color=blue]
    > 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?[/color]


    Comment

    • Chris Hohmann

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

      "Boolean" <thecoconutmonk ey@hotmail.com> wrote in message
      news:85e18f4e.0 407280630.7d73f 60f@posting.goo gle.com...[color=blue]
      > 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?[/color]

      Database? Version? DDL? Sample Data? Desired Output?


      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.


      Comment

      • just1coder@yahoo.ca

        #4
        Function Help

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

        function IsEmailValid(em ail)
        dim sql
        sql = "usp_isemailval id " & email
        set rs = conn.execute(sq l)
        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(em ail) = true then
        response.write( "success!")
        else
        response.write( "fraid not!")
        end if

        Comment

        • dlbjr

          #5
          Re: Function Help

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


          dlbjr
          Pleading sagacious indoctrination!


          Comment

          Working...