Herve wrote:
...
I did the following:
generate fyr2 = string(fyr,"%td")
It works but I now have a sorting problem. With the old fyr
variable, dates are ordered chronologically. With the new
fyr2 variable, dates are ordered "alphabetically".
...
========================================================
Use a sortable date format (year, month, day):
generate fyr2 = string(fyr,"%tdCCYY-NN-DD")
Best wishes,
Svend
__________________________________________
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C, Denmark
Phone: +45 8942 6090
Home: +45 8693 7796
Email: [email protected]
__________________________________________
*
* 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/