Hi,
I'm trying to build a deidentified ID from pieces of first and last names plus the year of birth. Is there a function that will extract part of a date, in particular the year?
Thanks.
How do I extract the year from a date?
-
- Posts: 1801
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: How do I extract the year from a date?
It all depends on how your date is stored. You may just have to do some algebra. For example, if your date is stored in YYYYMMDD numeric format, you could get the year by writing:
YEAR = int(DATE / 10000);
Re: How do I extract the year from a date?
Thanks Gregory!