[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Importing date data
If you can read the variable in as a string, you could call it
the ymd variable.
Then you could use the following code:
generate mdate=daily(ymd, "ymd")
Then you could format the mdate function as follows:
format mdate %td.
This would convert it to a Stata date variable.
Robert A. Yaffee, Ph.D.
Shirley M. Ehrenkranz
School of Social Work
New York University
2100 Linwood Ave.
Fort Lee, NJ
----- Original Message -----
From: Nuno Soares <email@example.com>
Date: Sunday, June 25, 2006 6:03 am
Subject: st: Importing date data
> Hi everyone,
> I have a file that has a variable date using the format YYMMDD, and I
> haven't been able to import it as a date format to Stata. I've been
> usingthe -infix- command. I don't have any problem to import it as
> number but
> then I would loose the date information. For instance, I have one
> observation that has 000112, i.e., 2000/01/12 and Stata reads it as
> 112...If anyone could give a idea of how to solve this issue, I
> would be greatly
> * 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/
* For searches and help try: