Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: decoding a date variable


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: decoding a date variable
Date   Tue, 23 Aug 2005 18:06:29 +0100

As is explicit, -decode- makes no sense without value
labels. 

I can't see why one would need this, but 
you can use the -string()- function with an appropriate
format, e.g. 

gen sdate = string(mydate, "%dd_M_CY") 

or equivalently -tostring- with an appropriate
format. 

Nick 
n.j.cox@durham.ac.uk 

bmilanovic@worldbank.org
 
> How do I convert a date format variable into a string variable?
> 
> When I do decode, i get the message that the variable i want 
> to decode is not labeled.

*
*   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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index