At 12:19 AM 3/6/2004 +0000, Paul O'Brien wrote:
Hi,
gen year= year( datevisit) gives me the calendar year of the clinic visit.
How do I get the financial year of the visit, starting on the 1st April
each year?
Not sure, but how about
gen year = year(datevisit - 91)
91 corresponds to April 1, 1960.
When I try this with a few #s, I get
+-----------------------------------------+
| datevi~t month day year finyear |
|-----------------------------------------|
1. | 89 3 30 1960 1959 |
2. | 90 3 31 1960 1959 |
3. | 91 4 1 1960 1960 |
+-----------------------------------------+
*
* 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/