cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
View Original Published Thread

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" ))