- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
Thanks,
mgm
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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" ))
Year(Parse Date( "07/15/2000" ))