Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: AW: Converting date strings into dates


From   DE SOUZA Eric <eric.de_souza@coleurope.eu>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: AW: Converting date strings into dates
Date   Mon, 15 Feb 2010 16:42:26 +0100

Thanks, Martin.
Instead of monthly, I had put date; and that gave me huge numbers

Eric 


Eric de Souza
College of Europe
Dyver 11
BE-8000 Brugge (Bruges)
Belgium

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Martin Weiss
Sent: 15 February 2010 16:17
To: statalist@hsphsun2.harvard.edu
Subject: st: AW: Converting date strings into dates


<> 



*************
clear*

input  str10 stringdate
1999Jan
1999Feb
end

gen double date=monthly(stringdate , "YM") format date %tmMonth_CCYY l
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von DE SOUZA Eric
Gesendet: Montag, 15. Februar 2010 15:47
An: Statalist
Betreff: st: Converting date strings into dates

I have never quite mastered the technique of converting date strings into dates.
In this case, I have a string variable of the form: 1999Jan 1999Feb and so on, and wish to convert it into a date Thanks for any help.

Eric

Eric de Souza
College of Europe
Dyver 11
BE-8000 Brugge (Bruges)
Belgium



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