[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: String -> date format conversion with insheet
At 10:52 21/11/03 -0500, Eric Hixson wrote:
I have a dataset with dates that I am brining into Stata via insheet. The
data is comma delimited and the dates are being formatted by the source
database like the following:
Use -split- to split the string into date and time. Then convert the date
in the usual way.
Unfortunately I can't get rid of the h/m/sec portion at the source and
Stata is formatting the field as a string. I want to convert the m/d/y
portion to a date to allow time series analysis.
I tried dstring as a first step and got the following:
. destring dischdate, g(ddate) ignore(" 0:00:00")
dischdate contains characters not specified in ignore(); no generate
The same error was produced with and without the quotes and/or leading
space in the ignore statement. Recast does not allow date as a type.
Any thoughts on how to handle the conversion would be appreciated.
Lecturer in Medical Statistics
Department of Public Health Sciences
King's College London
5th Floor, Capital House
42 Weston Street
London SE1 3QD
Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
or 020 7848 6605 International +44 20 7848 6605
Opinions expressed are those of the author, not the institution.
* For searches and help try: