From | Roger Newson <[email protected]> |
To | [email protected] |
Subject | Re: st: String -> date format conversion with insheet |
Date | Fri, 21 Nov 2003 16:12:59 +0000 |
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.
3/12/03 0:00:00
11/5/03 0:00:00
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.
© Copyright 1996–2024 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |