[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

MS VS-2005 Function Null value return ''

I have the following function to convert "1/1/1900" date into " " which is working
However if the value is null then this function is not working.

  Protected Function PARSEDATE(ByVal ARG) As String

        If ARG.ToString().StartsWith("1/1/1900") Then
            Return " "
        Else
            Return ARG
        End If

    End Function

Could you please help how to fix that
0
Mehram
Asked:
Mehram
1 Solution
 
jimstarCommented:
Check if ARG is null:

If IsNull(ARG) Then
Return " "
Else
' do your stuff here
End If
0
 
MehramAuthor Commented:
isnull is not working
0
 
appariCommented:
try

Protected Function PARSEDATE(ByVal ARG) As String

        If ARG is nothing orelse ARG.ToString().StartsWith("1/1/1900") Then
            Return " "
        Else
            Return ARG
        End If

    End Function
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now