Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
CVDate Function
This standard VB function converts an expression to the data type variant of type date.
Syntax
CVDate(expression)
Returns
The value of expression expressed as a variant of vartype 7 (date).
Usage
CVDate accepts both string and numeric values.
The CVDate function returns a variant of vartype 7 (date) that represents a date from January 1, 100, through December 31, 9999. A value of 2 represents January 1, 1900. Times are represented as fractional days.
CVDate converts the time portion of a date expression if one is included as part of the expression, or if the time expression is the only argument. For ways to display the desired result of a date conversion, read Format Function.
Example
This example displays the date for one week from the date entered by the user.
Sub Button_Click
Dim str1 as String
Dim nextweek
Dim msgtext as String
i:
str1 = "2/5/2001"
answer = IsDate(str1)
If answer = -1 then
str1 = CVDate(str1)
nextweek = DateValue(str1) + 7
msgtext = "One week from the date entered is:
msgtext = msgtext & "Format(nextweek,"dddddd")
Else
Goto i
End If
End SubSee Also
Asc Function
CCur Function
CDbl Function
Chr Function
CInt Function
CLng Function
CSng Function
CStr Function
CVar Function
DateValue Function
Format Function
Val Function
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |