Herve STOLOWY wrote:
In a data set, one variable (fyr) is the date of the financial year end.
The current displayed format is, e.g., 31 Dec 04, 30 Jun 04, 30 Sep
05... When I click on the year end, I see a figure (e.g., 16252). I
understood, reading the Stata documentation, that the format I am using
is that of elapsed dates. I understand the principle.
I need to use the date as a condition in:
replace year2 = 07 if fyr== 31 Dec 04
This does not work. (I also tried with quotes around the date). I guess
that it is because of the date format but can't find a solution in the
help file on dates.
Would you have any idea?
--------------------------------------------------------------------------------
In Stata Release 10:
replace year2 = 07 if fyr == date("31 Dec 04", "DMY")
In earlier releases:
replace year2 = 07 if fyr == date("31 Dec 04", "dmy")
Joseph Coveney
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/