Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function Error "A ( is expected here" 1

Status
Not open for further replies.

josephwc

Programmer
Oct 13, 2005
83
US
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



 
I'd guess that you have the syntax set to Crystal, change it to Basic Syntax in the function editor.

-k
 
thanks for the tip and catching my oversight. I appreciate it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top