another question about date dependent links

G

Glenn

Last week I asked how to change a hyperlink based on the current month, and
this reply worked:

<%
CurDate = Date()
CMth = Month(CurDate)

If CMth = 1 Then
Specials = "Janspec.pdf"
ElseIf CMth = 2 then
Specials = "Febspec.pdf"
ElseIf CMth = 3 then
..
..
..
ElseIf CMth = 12 then
Specials = "Decspec.pdf"
End If
%>

Now, I'd like to become a little more specific on a couple of pages, and
have it go by the actually date. I'd like to have some flexibility as well.

For instance, I'd like to be able to do something such as:

If the date is March 7 then insert glenn1.pdf

If the date is March 9 - 14 then insert glenn2.pdf

If the date is anything else then insert glenn3.pdf

Can someone help me with this, please?

Thank you.
 
S

Stefan B Rusynko

Just add a day test inside your month 3 test
CurDate = Date()
CMth = Month(CurDate)
CDay = Day(CurDate)
......
ElseIf CMth = 3 then
If CDay = 7 Then
Specials = "glenn1.pdf"
ElseIf (CDay >=9) OR (CDay <=14) then
Specials = "glenn2.pdf"
Else
Specials = "glenn3.pdf"
End If
......




| Last week I asked how to change a hyperlink based on the current month, and
| this reply worked:
|
| <%
| CurDate = Date()
| CMth = Month(CurDate)
|
| If CMth = 1 Then
| Specials = "Janspec.pdf"
| ElseIf CMth = 2 then
| Specials = "Febspec.pdf"
| ElseIf CMth = 3 then
| .
| .
| .
| ElseIf CMth = 12 then
| Specials = "Decspec.pdf"
| End If
| %>
|
| Now, I'd like to become a little more specific on a couple of pages, and
| have it go by the actually date. I'd like to have some flexibility as well.
|
| For instance, I'd like to be able to do something such as:
|
| If the date is March 7 then insert glenn1.pdf
|
| If the date is March 9 - 14 then insert glenn2.pdf
|
| If the date is anything else then insert glenn3.pdf
|
| Can someone help me with this, please?
|
| Thank you.
|
|
 
Top