Thanks, all. These suggestions work perfectly. I would like to also thank
Mingfeng Lin who responded to me off-line.
Ariel
Date: Thu, 27 Aug 2009 00:52:22 -0400
From: "Mert Demir" <[email protected]>
Subject: st: RE: extracting month and year from a date variable
Try this:
g mydate=date(date, "MDY") /* Second "date" is the 'original date
variable'.
format mydate %td
g dm=mofd(mydate)
format dm %tm
drop mydate
Hope it works.
Best,
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/