Time to think...

1. Rob Guest

## Time to think...

Ive got some code and it wont work and I&#039m totally bewildered why.<BR>I&#039ve tried varying strains on the below but to no avail.<BR>Any ideas muchly appreciated!<BR><BR>**<BR>&#060;% If hour(now) = 9 &#062;= 11 then<BR>Response.Write "9am or maybe its anything upto 11am...or something inbetween!"<BR>elseif hour(now) = 11 &#062;= 13 then<BR>Response.Write "Wish I knew the time better than 11am to 1pm. This is the time :"<BR>elseif hour(now) = 13 &#062;= 15 then<BR>Response.Write "Time Governor? 1pm to 3pm?! Time is :"<BR>elseif hour(now) = 15 &#062;= 17 then<BR>Response.Write "The time? Oh its between 3pm and 5pm. I&#039d check your watch :). The time on the server in <BR><BR>London who knows!"<BR>Else<BR>Response.Write "It should be between 5pm to 9am in the morning now!"<BR>End If %&#062;

2. BAHEK Guest

## RE: Time to think...

Incorrect sintax. Try this:<BR>If hour(now) = &#062;9 and hour(now) &#060; 11 then<BR>got the point?<BR>Or you can have it this way:<BR>&#060;%<BR>Select case hour(now)<BR> Case 9-11<BR> &#039blahblahblah<BR> Case 11-15<BR> &#039blahblahblah<BR>end select<BR>%&#062;<BR><BR>just play with it.

3. burnedbefore Guest

## RE: Time to think...

Use &#039To&#039 for a range<BR><BR>Case 9 To 11 &#039Range<BR>Case 9 - 11, -2 &#039The same<BR>

4. Senior Member
Join Date
Dec 1969
Posts
2,493

## RE: Time to think...

&#060;% If hour(now) &#062;= 9 And hour(now)&#060;= 11 then<BR>Response.Write "9am or maybe its anything upto 11am...or something inbetween!"<BR>elseif hour(now) &#062;= 11 And hour(now)&#060;= 13 then<BR>Response.Write "Wish I knew the time better than 11am to 1pm. This is the time :"<BR>elseif hour(now) &#062;= 13 And hour(now)&#060;= 15 then<BR>Response.Write "Time Governor? 1pm to 3pm?! Time is :"<BR>elseif hour(now) &#062;= 15 And hour(now)&#060;= 17 then<BR>Response.Write "The time? Oh its between 3pm and 5pm. I&#039d check your watch :). The time on the server in <BR><BR>London who knows!"<BR>Else<BR>Response.Write "It should be between 5pm to 9am in the morning now!"<BR>End If %&#062;

5. Senior Member
Join Date
Dec 1969
Posts
2,493

## RE: Time to think...

&#060;% If hour(now) &#062;= 9 And hour(now)&#060;= 11 then<BR>Response.Write "9am or maybe its anything upto 11am...or something inbetween!"<BR>elseif hour(now) &#062;= 11 And hour(now)&#060;= 13 then<BR>Response.Write "Wish I knew the time better than 11am to 1pm. This is the time :"<BR>elseif hour(now) &#062;= 13 And hour(now)&#060;= 15 then<BR>Response.Write "Time Governor? 1pm to 3pm?! Time is :"<BR>elseif hour(now) &#062;= 15 And hour(now)&#060;= 17 then<BR>Response.Write "The time? Oh its between 3pm and 5pm. I&#039d check your watch :). The time on the server in <BR><BR>London who knows!"<BR>Else<BR>Response.Write "It should be between 5pm to 9am in the morning now!"<BR>End If %&#062;

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•