Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Reformatting all dates in a Stata dataset


From   "James Morden" <[email protected]>
To   <[email protected]>
Subject   st: Reformatting all dates in a Stata dataset
Date   Wed, 02 Feb 2011 11:04:38 +0000

Dear all,

I am importing lots of datasets from Access into Stata using the odbc command. The automatic format of all my dates after I have imported the dataset is %tc which includes date and time. I would ideally like all my dates to be %td, i.e just date. Does anyone know of a command that would go through my variables one by one and say if format = %tc, reformat as %td.

I have tried to find a way of referring to the format tag attached to each variable but have not managed this so far. I am using Stata 10.

Many thanks,
James

James Morden
Medical Statistician
ICR Clinical Trials and Statistics Unit (ICR-CTSU)
Section of Clinical Trials
The Institute of Cancer Research
Sir Richard Doll Building
Cotswold Road
Sutton, Surrey
SM2 5NG

Tel: 020 8722 4187


The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network.

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index