Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: Date format

From   Nick Cox <>
Subject   Re: st: Date format
Date   Sat, 29 Sep 2012 16:50:38 +0100

If -date- is a daily date variable then

list date if date == mdy(3,31,2011)

will list all instances of that date in the variable -date- in your data.

That won't be very interesting. You will probably find something like

list if date == mdy(3,31,2011)

more helpful. Note that


as your wrote it can't mean anything in this context, as it can't be
the name of a variable or scalar, and it can't be a literal string as
it is not delimited by " ". (Nor would a literal string be any use
here as dates in Stata are numeric.)


On Sat, Sep 29, 2012 at 4:37 PM, Sebastian Skalitzky
<> wrote:

> I am having a problem with my date variable. I want to list all
> observations which occurred at the same date.
> Therefore I tried the following line:
> list date if==31mar2011
> however I receive the following message
> 31mar2011 invalid name
> r(198);
> Some information on the variable date:
> Type: long
> Format: %d
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index