Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > Month FunctionThis standard VB function returns an integer for the month component (1-12) of a date-time value. SyntaxReturnsIf the expression evaluates to a date-time or date value, the month component of that value; otherwise 0. UsageDate can be of any type, including string, and the Month function attempts to convert the input value to a date-time value. For Month to function without an error, the values passed to it must be in some form that can be interpreted as a time or date-time value. Thus, 11/20, or 11-20-2001 returns valid results, but 1120 returns a 0. 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. ExampleThis example finds the month (1-12) and day (1-31) values for this Thursday. Sub Button_Click See AlsoDate Statement |
Siebel VB Language Reference |