Nathaniel
|
| Posted: 06/30/2003, 12:10 PM |
|
CCS 2.1.1.20
ASP
XP Pro
I have a production application that has worked fine until I stated to input events that occur in the month of July.
The application groups events by date and display them under a group title (a label) noting the day of the week.
See acutal page by accessing: http://www.beulahbaptist.org/admin/waag_list.asp
Problem: 6/30/02, a Monday, work fine.
7/1/2003, a Tuesday, displays as a Sunday. All other july dates are also displaying the wrong date.
Listed below you will find the custom code for the Day of the week label.
================= Custom Label Code ===========================
Dim CurrentDate, DayName
CurrentDate = waag.EventDate.value
DayName = WeekdayName(Weekday(Day(CurrentDate)))
waag.DayOfTheWeekName.value = DayName
=================================================================
=======================Custom Code to Group Events by the day =============
If NameOfDay = waag.DayOfTheWeekName.Value Then
waag.DayOfTheWeekName.Visible = False
Else
waag.DayOfTheWeekName.Visible = True
NameOfDay = waag.DayOfTheWeekName.Value
End If
===========================================================================
Please understand I am a novice at this. Hopefully someone can detect a coding problem on my part.
Thanks in advance for your help.
Nate
|
|
|
 |
Nathaniel
|
| Posted: 06/30/2003, 7:21 PM |
|
Please disregard my post. I found my problem. I should have been using DatePart() to determine the day of the week and not Day(). Listed below is the code that corrected my problem.
Thanks
===============Revised Custom Code ===============================
Dim CurrentDate, DayName
CurrentDate = waag.EventDate.value
DayName = DatePart("w",CurrentDate)
Select Case DayName
Case 1
waag.DayOfTheWeekName.value = "Sunday"
Case 2
waag.DayOfTheWeekName.value = "Monday"
Case 3
waag.DayOfTheWeekName.value = "Tuesday"
Case 4
waag.DayOfTheWeekName.value = "Wednesday"
Case 5
waag.DayOfTheWeekName.value = "Thursday"
Case 6
waag.DayOfTheWeekName.value = "Friday"
Case Else
waag.DayOfTheWeekName.value = "Saturday"
End Select
|
|
|
 |
|