H
Heather
I inherited a db and am having a hard time understanding
this. The field is called SCHSTART and an example of a
date is 12/31/2003. The code is below. It is being
populated into a new table can any one explain this part
of the code and what the output would be for the date
12/31/2003? THANKS...
If Weekday(rsx!SCHSTART) = 6 Then
rs!we_dt = rsx!SCHSTART + 1
ElseIf Weekday(rsx!SCHSTART) = 5 Then
rs!we_dt = rsx!SCHSTART + 2
ElseIf Weekday(rsx!SCHSTART) = 4 Then
rs!we_dt = rsx!SCHSTART + 3
ElseIf Weekday(rsx!SCHSTART) = 3 Then
rs!we_dt = rsx!SCHSTART + 4
ElseIf Weekday(rsx!SCHSTART) = 2 Then
rs!we_dt = rsx!SCHSTART + 5
ElseIf Weekday(rsx!SCHSTART) = 1 Then
rs!we_dt = rsx!SCHSTART + 6
Else
rs!we_dt = rsx!SCHSTART
End If
this. The field is called SCHSTART and an example of a
date is 12/31/2003. The code is below. It is being
populated into a new table can any one explain this part
of the code and what the output would be for the date
12/31/2003? THANKS...
If Weekday(rsx!SCHSTART) = 6 Then
rs!we_dt = rsx!SCHSTART + 1
ElseIf Weekday(rsx!SCHSTART) = 5 Then
rs!we_dt = rsx!SCHSTART + 2
ElseIf Weekday(rsx!SCHSTART) = 4 Then
rs!we_dt = rsx!SCHSTART + 3
ElseIf Weekday(rsx!SCHSTART) = 3 Then
rs!we_dt = rsx!SCHSTART + 4
ElseIf Weekday(rsx!SCHSTART) = 2 Then
rs!we_dt = rsx!SCHSTART + 5
ElseIf Weekday(rsx!SCHSTART) = 1 Then
rs!we_dt = rsx!SCHSTART + 6
Else
rs!we_dt = rsx!SCHSTART
End If