Statalist


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

st: AW: Formating a date to a local macro variable


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: Formating a date to a local macro variable
Date   Fri, 17 Jul 2009 21:29:22 +0200

<>

Note -h extended_fcn-, search for "Macro extended function for formatting
results"...

HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Susheel Patil
Gesendet: Freitag, 17. Juli 2009 21:11
An: 'statalist@hsphsun2.harvard.edu'
Betreff: st: Formating a date to a local macro variable

I have a variable "date" that contains the date that a particular assay was
run (the variable is in a data format). I would like to assign the date in a
particular observation to a local macro variable (its the same date for all
observations). Currently when it does this it assigns it a number in stata
date format relative to Jan 1, 1960. Is there a way to assign it to the
local macro variable in a way that it will formatted in a "readable" date
format?

		quietly sum date if tmp_dp ==`i'
		local date = r(mean)

Thanks,

Susheel

-------------------------------------------------------------------
Susheel P. Patil, M.D., Ph.D.
Assistant Professor of Medicine
Johns Hopkins Sleep Disorders Center
Asthma and Allergy Center
5501 Hopkins Bayview Circle, Room 4B.41
Baltimore, MD 21224
 
Phone: 410-550-2335
Fax:410-550-3374
-------------------------------------------------------------------


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


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index