Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: RE: preserving leading zeros in destring


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: RE: preserving leading zeros in destring
Date   Thu, 28 Aug 2008 21:44:55 +0100

Pleased you solved your problem. 

On the last point: I would not take it upon myself to comment on what is
kosher. 

On what is in order on Statalist: There are no precise rules and I
wouldn't want to propose any. So it is anybody's judgment call. But my
prejudices are firm: archiving by thread is valuable to all who search
the archives, and so even if threads wiggle and waggle a bit, and most
do, keeping threads together is important. 

So I'd advise renaming a thread only if there is a complete change of
subject, not the case here. 

Nick 
[email protected] 

Michael McCulloch

To summarize, Nick Cox suggested below a solution to my problem, 
which was that in Stata 9.2, after importing dates from Excel.csv in 
the format "MM/DD/YY", I couldn't get -date- to work.

Here's the solution, succinctly, in which an Excel spreadsheet saved 
in *.csv format contains a variable called date, formatted with Excel 
date format MM/DD/YY:

insheet using "my_sheet.csv", clear
gen newdate= date(date, "mdy", 2010)
format newdate %d
list

My apologies for not having specified I'm using Stata 9.2

As a matter of Statalist procedure, in a case like this where the 
answer isn't reflected in the title of my original post, is it Kosher 
to re-submit the problem & solution in a newly titled post, so others 
may find it more easily when searching the Statalist archives?

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index