Date time variable returns value when there is no value set

Hi All,

Just assign a date time variable and I give the value as nothing
But while right the out put it shows the output as 01/01/0001 00:00:00

I need output if we give date value then I need that one there is empty means it returns empty value

But here I have above issue can you give me solution for this…

Thanks,
Vicky

normally for date the default value will be output

it is normal behavior instead you check for the value then based on that you can decide
the next steps

Regards

1 Like

Hi @Vicky_K ,

As already mentioned above, we would need to go ahead with Date Comparison if you are assigning Nothing to it as value.

For that Purpose, we can compare the Date variable you have assigned with Nothing is equal to DateTime.MinValue or not, as both values would be the same :
image

2 Likes

Hi @Vicky_K

Try this-

If myDateTime.Equals(DateTime.MinValue) Then
// DateTime variable is empty
Else
// DateTime variable has a value
End If

Thanks,

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.