Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
DateSerial Function
This standard VB function returns a date value for the year, month, and day specified.
Syntax
DateSerial(year, month, day)
Returns
A variant of vartype 7 (date) that represents a date from January 1, 100, through December 31, 9999, where January 1, 1900, is 2.
Usage
A numeric expression can be used for any of the arguments to specify a relative date: a number of days, months, or years before or after a certain date.
Example
This example finds the day of the week for November 7 in the year 2009.
Sub Button_Click
Dim checkdate As Variant, daynumber As Variant
Dim msgtext As String, checkday as Variant
Const checkyear = 2009
Const checkmonth = 11
checkday = 7
checkdate = DateSerial(checkyear,checkmonth,checkday)
daynumber = Weekday(checkdate)
msgtext = "November 7, 2009 falls on a " & _
Format(daynumber, "dddd")
End SubSee Also
DateValue Function
Day Function
Format Function
Month Function
Now Function
TimeSerial Function
TimeValue Function
WebApplet_InvokeMethod Event
Year Function
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |