PDA

Click to See Complete Forum and Search --> : [RESOLVED] CR 10.2 Error Message in Formula???


blakemckenna
Apr 11th, 2007, 09:50 AM
I am getting the following error message on the highlighted code from a Crystal Report 10.2 formula:

"A variable type (for example 'String') is missing"

Here is my CR Formula in Basic Syntax


Dim intMonth as Int

intMonth = Month (DateValue ({tblTimeSheetDetail.beginPeriodDate}))

Select Case intMonth
Case 1
Formula = "January"
Case 2
Formula = "February"
Case 3
Formula = "March"
Case 4
Formula = "April"
Case 5
Formula = "May"
Case 6
Formula = "June"
Case 7
Formula = "July"
Case 8
Formula = "August"
Case 9
Formula = "September"
Case 10
Formula = "October"
Case 11
Formula = "November"
Case 12
Formula = "December"
End Select


What am I doing wrong?

Thanks,

brucevde
Apr 11th, 2007, 11:31 AM
int isn't a variable type. Crystal does not have integer types. Use

Dim x As Number

or simply

formula=MonthName (Month (DateValue ({tblTimeSheetDetail.beginPeriodDate})))

blakemckenna
Apr 11th, 2007, 12:01 PM
Thanks Bruce!