Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 2nd, 2003, 02:48 PM
eon eon is offline
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?

 
Old October 4th, 2003, 04:12 AM
Registered User
 
Join Date: Jul 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to admin@martine.cz Send a message via MSN to admin@martine.cz
Default

Hi,

You must add reference for this:

Microsoft.VisualBasic.DateAndTime

Martin Chundela





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using month & year variable to get date in range rsearing ASP.NET 2.0 Professional 2 July 5th, 2008 08:30 AM
Exact year month and days mankoti_mankoti2000 Access 1 July 3rd, 2008 10:05 AM
How to pull Month & Year from Date(dd/mm/yyyy) istcomnet Classic ASP Basics 2 April 22nd, 2008 06:22 PM
Month and Year to Date on a Report Mitch Access 2 February 20th, 2007 10:23 AM
get year,month,day,hour... kobystud C# 1 July 16th, 2004 04:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.