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.