Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Using a date in a condition


From   Herve STOLOWY <stolowy@hec.fr>
To   statalist@hsphsun2.harvard.edu
Subject   st: Using a date in a condition
Date   Wed, 20 Feb 2008 15:48:06 +0100

Dear Statalisters:

In a data set, one variable (fyr) is the date of the financial year end.
The current displayed format is, e.g., 31 Dec 04, 30 Jun 04, 30 Sep
05... When  I click on the year end, I see a figure (e.g., 16252). I
understood, reading the Stata documentation, that the format I am using
is that of elapsed dates. I understand the principle. 

I need to use the date as a condition in: 

replace year2 = 07 if fyr== 31 Dec 04

This does not work. (I also tried with quotes around the date). I guess
that it is because of the date format but can't find a solution in the
help file on dates.

Would you have any idea?

Best regards

Hervé Stolowy

***********************************************************
Professeur/Professor
President of the French Accounting Association
HEC Paris
Département Comptabilité Contrôle de gestion / Dept of Accounting and
Management Control
1, rue de la Liberation
78351 - Jouy-en-Josas
France
Tel: +33 1 39 67 94 42 - Fax: +33 1 39 67 70 86
mail: stolowy at hec dot fr
web: http://www.hec.fr/stolowy


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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