Statalist


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

st: preserving leading zeros in destring


From   Michael McCulloch <mm@pinest.org>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: preserving leading zeros in destring
Date   Wed, 27 Aug 2008 13:42:08 -0700

Hello,
I want to destring a variable, which contains dates in the format 
"MM/DD/YY", using:
	destring date, replace ignore("/") force

How can I set this to preserve the leading zeroes, so that I can follow with:
	todate date, gen(newdate) pattern(mmddyy) f(%d)

Any suggestions would be much appreciated.

-- 

Best wishes,
Michael McCulloch



Pine Street Foundation
124 Pine St., San Anselmo, CA 94960-2674
Tel:	(415) 407-1357
Fax:	(415) 485-1065
mcculloch@pinestreetfoundation.org
www.pinestreetfoundation.org

*
*   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   |   What's new   |   Site index