Hello,
Crystal 11
In copying a function from another report and attempting to save I get the error "A ( is expected here" The function has not been modified at all. The function name is GetTotalPossibleHours and the code is below. ????
Function GetTotalPossibleHours(Startdate as datetime, EndDate as datetime)
dim FullWeekDays as number
dim ModDays as number
dim DOWDays as number
dim PartWeekDays as number
dim WholeStartDate as date
WholeStartDate = DateValue( Year(Startdate), Month(Startdate), Day(Startdate))
FullWeekDays = int( (EndDate - WholeStartDate + 1) /7) * 5
ModDays = (EndDate - WholeStartDate + 1) mod 7
DOWDays = DayOfWeek (EndDate)
IF DOWDays = 7 THEN
DOWDays = 0
END IF
IF DOWDays < 2 THEN
IF ModDays - (DOWDays + 1) >0 then
PartWeekDays = ModDays - (DOWDays + 1)
ELSE
PartWeekDays = 0
END IF
ELSE
IF DOWDays > ModDays THEN
PartWeekDays = ModDays
ELSE
IF DOWDays = ModDays THEN
PartWeekDays = ModDays - 1
ELSE
PartWeekDays = ModDays - 2
END IF
END IF
END IF
GetTotalPossibleHours = (FullWeekDays + PartWeekDays) * 8
End Function
Crystal 11
In copying a function from another report and attempting to save I get the error "A ( is expected here" The function has not been modified at all. The function name is GetTotalPossibleHours and the code is below. ????
Function GetTotalPossibleHours(Startdate as datetime, EndDate as datetime)
dim FullWeekDays as number
dim ModDays as number
dim DOWDays as number
dim PartWeekDays as number
dim WholeStartDate as date
WholeStartDate = DateValue( Year(Startdate), Month(Startdate), Day(Startdate))
FullWeekDays = int( (EndDate - WholeStartDate + 1) /7) * 5
ModDays = (EndDate - WholeStartDate + 1) mod 7
DOWDays = DayOfWeek (EndDate)
IF DOWDays = 7 THEN
DOWDays = 0
END IF
IF DOWDays < 2 THEN
IF ModDays - (DOWDays + 1) >0 then
PartWeekDays = ModDays - (DOWDays + 1)
ELSE
PartWeekDays = 0
END IF
ELSE
IF DOWDays > ModDays THEN
PartWeekDays = ModDays
ELSE
IF DOWDays = ModDays THEN
PartWeekDays = ModDays - 1
ELSE
PartWeekDays = ModDays - 2
END IF
END IF
END IF
GetTotalPossibleHours = (FullWeekDays + PartWeekDays) * 8
End Function