Siebel VB Language Reference > Methods Reference for Siebel VB > Date and Time Methods >

Extract Day From Date-Time Value Method


The Extract Day From Date-Time Value method returns the day component of a date and time value. The return value is an integer variable type in the range of 1 through 31. If the return value is null, then it returns a null variable type. For more information, see Variants.

Format

Day(date)

The argument that this method uses is the same as the argument that the Convert String to Date method uses. For more information, see Convert String to Date Method.

Example

The following example finds the month in the range of 1 through 12 and the day in the range of 1 through 31 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
   Loop
   msgtext = "This Thursday is: " & Month(Today + x) & "/" & _
      Day(Today + x)
End Sub

Siebel VB Language Reference Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.