Siebel VB Language Reference > VB Language Reference >

Day Function

This standard VB function returns the day of the month of a date-time value.





Any expression that can evaluate to a date


Day attempts to convert the input value of date to a date value. The return value is a variant of vartype 2 (integer). If the value of date is null, a variant of vartype 1 (null) is returned.


This example finds the month (1 to 12) and day (1 to 31) values for this Thursday.

Sub Button_Click
   Dim x As Integer, Today As Variant, msgtext As String
   Today = DateValue(Now)
   Let x = 0
   Do While Weekday(Today + x) <> 5
   x = x + 1
   msgtext = "This Thursday is: " & Month(Today + x) & "/" & _
      Day(Today + x)
End Sub

See Also

Date Function
Date Statement
Hour Function
Minute Function
Month Function
Now Function
Second Function
WebApplet_InvokeMethod Event
Year Function

Siebel VB Language Reference