if statement

A

alexz

I'm trying to write an if statement
i have two field, Status and Attendance.
"status" value can be active or inactive
"Attendance" value is active or blank

i wanted to right an if statement in which
if Status=("inactive")
response.write("N/A")

elseif Status=attendance
response.write("Attended")
else
response.write("No Show")
 
A

Aaron Bertrand - MVP

if status = "inactive" then
response.write "N/A"
elseif status = attendance then
response.write "Attended"
else
response.write "No Show"
end if
 
B

Bob Barrows

alexz said:
I'm trying to write an if statement
i have two field, Status and Attendance.
"status" value can be active or inactive
"Attendance" value is active or blank

i wanted to right an if statement in which
if Status=("inactive")
response.write("N/A")

elseif Status=attendance
response.write("Attended")
else
response.write("No Show")

You've almost got it if you're using vbscript:

dim sStatus, sAttendance
sStatus = Request.Form("Status")
sAttendance = Request.Form("Attendance ")

if sStatus="inactive" then
response.write "N/A"
elseif sStatus=sAttendance then
response.write "Attended"
else
response.write "No Show"
end if

HTH,
Bob Barrows
 
A

alexz

Bob Barrows said:
You've almost got it if you're using vbscript:

dim sStatus, sAttendance
sStatus = Request.Form("Status")
sAttendance = Request.Form("Attendance ")

if sStatus="inactive" then
response.write "N/A"
elseif sStatus=sAttendance then
response.write "Attended"
else
response.write "No Show"
end if

HTH,
Bob Barrows

Perfect.
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top