Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 2nd, 2003, 02:48 PM
eon eon is offline
Registered User
 
Join Date: Sep 2003
Location: , , .
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?

  #2 (permalink)  
Old October 4th, 2003, 04:12 AM
Registered User
 
Join Date: Jul 2003
Location: Olomouc, , Czech Republic.
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:45 PM.


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