<%
Dim dat
dat=WeekDay(Date)
%>
<%
Select Case dat
case 1
response.write("Today is Sunday")
case 2
response.write("Today is Monday")
case 3
response.write("Today is Tuesday")
case 4
response.write("Today is Wednesday")
case 5
response.write("Today is Thursday")
case 6
response.write("Today is Friday")
case 7
response.write("Today is Saturday")
end select %>
| Result:
Today is SaturdayThis example is to show the use of case statement and there
is better way to show the day of the week in asp. The variable
dat is set to the day of the week and it could have values from 1 to 7, 1 is Sunday and 7 is Saturday.
Case statement is used to display the day of the week
according to the value of variable dat. |