Is Expression a Date Method
The Is Expression a Date method determines if an expression evaluates to a date that Siebel VB allows. It returns one of the following values:
-1 (negative one). The expression is a date variable type or a string that Siebel VB can interpret as a date.
0 (zero). The expression is not a date variable type or a string that Siebel VB can interpret as a date.
For more information, see Variants.
Format
IsDate(expression)
The following table describes the arguments that you can use with this method.
Argument | Description |
---|---|
expression |
Any valid expression. |
Example
The following example adds a number to the current date value and determines if it is still a valid date. In this example, a valid date is in the range of January 1, 100, through December 31, 9999:
Sub Button_Click
Dim curdatevalue
Dim yrs
Dim msgtext
curdatevalue = DateValue(Date$)
yrs = 20
yrs = yrs * 365
curdatevalue = curdatevalue + yrs
If IsDate(curdatevalue) = -1 then
msgtext = Format(CVDate(curdatevalue))
Else
"The date is not valid."
End If
End Sub