Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: diff data types for date var while importing from various sources
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: diff data types for date var while importing from various sources
Date
Fri, 29 Jun 2012 09:15:10 +0200
On Thu, Jun 28, 2012 at 5:59 PM, tashi lama wrote:
> When I use odbc command to import data variable from sql database into stata, date variable turns numeric datatype. Quite contrary, when I use stockquote to import data variable to stata from yahoo finace, it assigns string datatype to date. Any idea or cOuld someone point me to a documentation how stata assigns datatype to imported variable specifically date?
I would say this is not a problem with Stata but with the original
data. If a variable is a string in the original dataset, than Stata
has no way of knowing that it is some special type of string (e.g. a
date), so it will correctly import the string variable as a string and
leaves it up to you to convert it into a date (see: -help datetime-).
-- Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/