troubleshooting Question

SSRS custom code [BC30037] Character not valid

Avatar of Jeanniem
Jeanniem asked on
Visual Basic.NETMicrosoft SQL Server 2005VB Script
5 Comments1 Solution3894 ViewsLast Modified:
I am using the following custom code in SQL Services Reporting Services (2005).
Function fmtreg(ByVal regtime As string) As String
dim newregtime As String
dim length As Integer
length = len(trim(regtime))
Select Case length
      Case length < 4
            return "error"
      Case = 4
            newregtime =   "0" & left(regtime,1) & ":" & "0" & mid(regtime,2,1)
            return newregtime
      Case =  5
            newregtime =  "0" & left(regtime,1) & ":" & mid(regtime,2,2)
            return newregtime
      Case = 6
            newregtime =  left(regtime,2) & ":"  & mid(regtime,3,2)
            return newregtime
      Case length > 6
            return "error"
End Select            
End Function
Function GetDays(ByVal CDateofReg As Date, CdateNewDocSees As Date, DocSees As Date)As Integer
Dim minsinhour as Integer
Dim RegToDocSees2 As Integer
Dim Sameday As Boolean
If  Day(CDateofReg) = Day(CdateNewDocSees) Then
      Sameday = true
      Sameday = false
End If
minsinhour = 60
If  IsNothing(DocSees)  Then
      RegToDocSees2 = 0
      Return RegToDocSees2
End If
If Sameday  =  true Then
 RegToDocSees2 = DateDiff("n",CdateNewDocSees,CDateOfReg)
Return RegToDocSees2                                          
      RegToDocSees2 = ((minsinhour  Minute(CDateofReg)) + Minute(CdateNewDocSees))
      Return RegToDocSees2
End If
End Function

When I execute, I get the following error message:
There is an error in line 38 of custom code [BC30037] Character not valid

Can anyone help me with this?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros