IF statements gone bad

O

oldmankirby

I have a problem I really can't figure out what I am doing wrong. I
have the following code:


stnum = "0"
inull = "SAM1"
aname = "a"
bname="a"

while Not rs.EOF

if (stnum <> rs("sn") and aname <> rs("fname") and bname <>
rs("lname") and inull = rs("idModule")) then
response.write ("<tr><td>Store #</td><td>&nbsp</td><td>&nbsp</
td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td></tr>")
response.write ("<tr><td><strong>" & rs("sn") & "</strong></
td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td></tr>")
response.write ("<tr><td>&nbsp</td><td>Employee ID</td><td>&nbsp</
td><td>Name</td><td>Position</td><td>Hire Date</td></tr>")
response.write ("<tr><td>&nbsp</td><td><font color = ""blue"">" &
rs("empid") & "</font></td><td>" & rs("idModule") & "</td><td>" &
rs("fname") & " " & rs("lname") & "</td><td>" & rs("description") & "</
td><td>" & rs("hiredate") & "</td><td>&nbsp</td></font></tr>")


elseif (stnum <> rs("sn") and aname <> rs("fname") and bname <>
rs("lname") and inull <> rs("idModule")) then
response.write ("<tr><td>Store #</td><td>&nbsp</td><td>&nbsp</
td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td></tr>")
response.write ("<tr><td><strong>" & rs("sn") & "</strong></
td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td><td>&nbsp</td></tr>")
response.write ("<tr><td>&nbsp</td><td>Employee ID</td><td>&nbsp</
td><td>Name</td><td>Position</td><td>Hire Date</td></tr>")
response.write ("<tr><td>&nbsp</td><td><font color =""red"">" &
rs("empid") & "</font></td><td>" & rs("idModule") & "</td><td>" &
rs("fname") & " " & rs("lname") & "</td><td>" & rs("description") & "</
td><td>" & rs("hiredate") & "</td><td>&nbsp</td></font></tr>")


else
response.write("<tr><td>&nbsp</td><td>&nbsp</td><td></td><td></td></
tr>")
response.write("<tr><td>" & rs("sn") & "</td><td>&nbsp</
td><td>&nbsp</td><td>" & rs("fname") & " " & rs("lname") & "</
td><td>&nbsp</td><td>" & rs("empid") & "<td>&nbsp</td><td>" &
rs("Description") & "</td><td>&nbsp</td><td>" & rs("HireDate") & "</
td></tr>")
end if

stnum = rs("sn")
aname = rs("fname")
bname = rs("lname")

rs.MoveNext

Wend




Here a sample of what the outout looks like:

Store #
2
Employee ID Name
Position Hire Date
9999999 SAM1 Sean
Analyst 6/4/2007

Sean
3 33333333 SAM3 Bob
test 6/1/2007

All the data is coming from a MS SQL DB. So here is my issue if SAM1
= idmodule then emp id is supposed to be blue if iit does not then
the employee id should be red. No matter what, the empid is red.
Where am I going wrong?
 

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,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top