0

I'm making an SSRS Report for my accounting team and I'm hitting a wall on their custom fields requirements.

I created a custom code function for this:

Public Function DateOrString(ByVal s As String) As String
    Try
        Dim dt = CDate(s)

        Return dt.ToString("d")
    Catch
        Return s
    End Try
End Function

Which when I ran that in VS it works like it should but when I used it in my SSRS report like so:

=Code.DateOrString(Fields!customuserfield1.Value)

works, but the date field is not converting at all

I need a string that equals "May 23 2011 12:00AM" to convert to "05/23/2011"

Not sure what's the disconnect is, hoping someone can tell me.

user692942
  • 16,398
  • 7
  • 76
  • 175
Eman
  • 1,093
  • 2
  • 26
  • 49

1 Answers1

0

After a lot of desk to head beating I got a working solution.

in the stored procedure I had to do some data cleaning so that my custom code would properly work, once I did that it worked like it should have.

Eman
  • 1,093
  • 2
  • 26
  • 49