Dear Statalisters,
When I import a date variable using odbc Stata changes the format from
yyyy-mm-dd to mmddyyyy--for example, 2002-07-01 to 01Jul2002.
I need to convert the date variable back to yyyy-mm-dd to be in the
proper database format. I do this in the following manner (variable is
datevar1):
foreach var in varlist datevar1 {
format datevar1 %dCY-N-D
}
Listing datevar1 via the command line displays the data in the proper
yyyy-mm-dd format. However, using odbc I get an "incorrect date value:
'1522'" error message, as the date variable somehow has been converted
to a number (date should be 2002-07-01).
Please help me understand the error of my ways...
Cheers,
Paul
*
* 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/