cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar

extract year from a mdy variable

I have variable collection.date, in m/d/y format, and I want to create another variable, yr, by extracting year from collection.date. I have tried using the year function in a formula but haven't had any success. Any suggestions?
Thanks,
mgm
1 REPLY 1
XanGregg
Staff

Re: extract year from a mdy variable

Year() will work if your variable is a numeric date, but if it's a character date, you'll have to parse it first.

Year(Parse Date( "07/15/2000" ))