Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[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   tashi lama <ltashi32@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: diff data types for date var while importing from various sources
Date   Thu, 28 Jun 2012 16:45:03 +0000

dates in the database are stored in datetime datatype which i think(not too sure though) is mysql exclusive. Having said that, they also have string datatypes. Thanx.

----------------------------------------
> Date: Thu, 28 Jun 2012 12:26:10 -0400
> Subject: Re: st: diff data types for date var while importing from various sources
> From: richard.c.herron@gmail.com
> To: statalist@hsphsun2.harvard.edu
>
> How are your dates stored in the database? Stata stores dates as
> numbers, but displays them as dates after you -format- them. See -help
> date- for more.
>
> When you use the -stockquote- package (from SSC, please state sources)
> Stata downloads the .csv file from Yahoo! Finance, where dates are
> stored as "YYYY-MM-DD" that Stata -insheet-s as a string. -insheet- is
> naive and doesn't know these strings are dates. You must convert this
> with something like -date(date, "YMD")-.
>
> Richard Herron
>
>
> On Thu, Jun 28, 2012 at 11:59 AM, tashi lama <ltashi32@hotmail.com> wrote:
> >
> > Hello,
> >
> > 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?
> >
> >
> >
> > Thanx,
> >
> > Tashi
> > *
> > * 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/
>
> *
> * 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/ 		 	   		  
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index