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


From   Thomas Speidel <[email protected]>
To   [email protected]
Subject   st: STRING to DATE
Date   Mon, 08 Mar 2004 10:52:41 -0700


I am trying to convert a string variable containing dates into a date
variable using the DATE command.
The dates in the string variable "dxday" are in the following format:

I used the following command:

. generate dxday2=date(dxday, "DM19Y")
(50 missing values generated)
Obviously, it did not work...

Does anyone know if there is an easy way to format this type of date
I guess the other way is to modify the data file directly to eliminate
the dashes, but I wonder if there is a more elegant mehod.


Thomas Speidel

This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
*   For searches and help try:

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