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

B

Boolean

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?
 
J

James Baker

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.
 
C

Chris Hohmann

Boolean said:
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.
 
J

just1coder

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
 
D

dlbjr

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


dlbjr
Pleading sagacious indoctrination!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top