Statalist


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

Re: st: Date format export to excel


From   Neil Shephard <[email protected]>
To   [email protected]
Subject   Re: st: Date format export to excel
Date   Wed, 10 Dec 2008 12:41:17 +0000

Ashim Kapoor wrote:
> Neil,
>
> I did open the stata file.
>
> the stata file has the number 500 in the cell. The format forces the
> 500 to appear as Sep 2001 when viewed using edit or list. This when
> outsheeted becomes 9/1/2008.
>   

This is not the behaviour I observer with Stata 10.1 (born 11 Aug 2008)...

. query born
11 Aug 2008

. list

     +------+
     | var1 |
     |------|
  1. |  500 |
  2. |  586 |
     +------+

. format %tmMon_CCYY var1

. list

     +----------+
     |     var1 |
     |----------|
  1. | Sep 2001 |
  2. | Nov 2008 |
     +----------+

. outsheet using c:/ado/tmp.txt, replace

When I then open c:/ado/tmp.txt in a text editor (e.g. Emacs or Notepad,
NOT Excel/Word), I have the following....

var1
Sep 2001
Nov 2008

Which version of Stata are you using?  Are you sure you have definately
set the format as you indicated in your original email?

Neil

-- 
"Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." - Albert Einstein


***********************************************************************
This  message  may  contain  confidential and  privileged  information.
If you  are not the  intended recipient  you should not  disclose, copy
or distribute information in this e-mail or take any action in reliance
on its contents.  To do so is strictly  prohibited and may be unlawful.
Please  inform  the  sender that  this  message has  gone astray before
deleting it.  Thank you.

2008 marks the 60th anniversary of the NHS.  It's an opportunity to pay
tribute to the NHS staff and volunteers who help shape the service, and
celebrate their achievements.

If you work for the NHS  and  would like  an NHSmail  email account, go
to: www.connectingforhealth.nhs.uk/nhsmail
***********************************************************************

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