Month() Year() questions
How come it's always the most simplest things that are the hardest to use. in the .net framework SDK documentation it says
Returns an Integer value from 1 through 9999 representing the year.
Public Function Year(ByVal DateValue As DateTime) As Integer
Parameter
DateValue
Required. Date value from which you want to extract the year.
You can also obtain the year by calling DatePart and specifying DateInterval.Year for the Interval argument.
Example
This example uses the Year function to obtain the year from a specified date. In the development environment, the date literal is displayed in short date format using the locale settings of your code.
Dim MyDate As Date
Dim MyYear As Integer
MyDate = #2/12/1969# ' Assign a date.
MyYear = Year(MyDate) ' MyYear contains 1969.
however, when I try to use year(strDate) it wont work, I get the following error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30469: Reference to a non-shared member requires an object reference.
any idea?
|