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" <[email protected]>
To   <[email protected]>
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 
[email protected] 

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