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!

Capture the year of a date 1

Status
Not open for further replies.

dulla

Technical User
Feb 3, 2003
54
0
0
hello i am trying to base the value of a field on date which is entered by the user. so if 'date_received' is entered as 1/23/03, i would like the value of the field 'past1' to equal 2001, 'past2' to 2002, etc. is there a way to separate out the year to execute this calculation? thanks.

ameen
 
past1 = Format(date_received, "yyyy")

that will take out year out of the date_received and put it in past1 variable.

Dragan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top