Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

store year as integer

Status
Not open for further replies.

tbac

Technical User
Jun 16, 2003
59
0
0
US
I tried to store the current year as a long integer and it is not working so far. Can someone help me with the correct format? Here is what I did:

Dim myear As Long
myear = Year(Now())
 
Code:
Dim myear As Long
myear = CLng(Year(Now()))


Zameer Abdulla
 
How are ya tbac . . .

Perhaps:
Code:
[blue]   variablename = CLng(Year(YourDateHere))[/blue]


See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
As a matter of interest, Why are you storing the date in an integer when there is a date type available and not using this negates you from using all the date functions ie dateadd() etc.

Just a thought.


Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top