Vania Gerova
>
> thanks for the suggestions!
> 33824 = 8th August 1992 in Excel.
> My variable looks like:
>
> 33824
> 5/25/1995
> 2/27/1995
> 33610
> 5/23/1995
> 6/22/2000
> 35550
>
> and so on, 1941 cases in one long column and it's a string.
Suppose this is string variable strvar
gen date =
cond(index(strvar,"/"),date(strvar,"mdy"),real(strvar)-21914)
That is,
if strvar contains "/", treat this as an "mdy" string date;
otherwise treat it as a number and subtract 21914.
format date %dd_m_Cy
or whatever.
Nick
[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/