Bookmark and Share

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]

st: formatting dates using "todate"


From   Alexey Lyubimov <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: formatting dates using "todate"
Date   Wed, 26 Mar 2014 17:03:22 +0000

Hi,
I have dates in one file formatted as 01nov2013, and in the second file they are formatted as 20131101.  I need to merge the files, so I am trying to convert the dates into the same format.  There is a posting in the archives as of Thu, 25 Oct 2007 09:36:11 -0500 which suggests the following code to convert YYYYMMDD to stata date format:
todate old_date, gen(new_date) pattern(yyyymmdd) format(%d)
I installed "todate" and tried to run this code, but I get the following error message: "length does not match pattern".
Does anyone have any suggestions on how to fix that?
Thank you



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index