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" <>
To   <>
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

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

> 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:

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