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, statalist.org is already up and running.


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

st: RE: RE: Counting Number of Week-Days


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: Counting Number of Week-Days
Date   Wed, 8 Sep 2010 00:12:09 +0200

<>

***********
clear*

inp str10 date
4apr2010
15apr2010
end

gen mydate=date(date, "DMY")
set obs `=mydate[2]-mydate[1]+1'
replace mydate=mydate[1]+_n-1

form mydate %td
l
cou if !inlist(dow(mydate), 0, 6)
***********


HTH
Martin

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Simone Peart
Boyce
Sent: Mittwoch, 8. September 2010 00:03
To: Stata
Subject: st: RE: Counting Number of Week-Days

Thanks Nick.  That helps somewhat.  I actually have two dates that I would
like 
to count the number of weekdays that transpire between them.  If for
example, 
date1=4apr2010 and date2=15apr2010, how can I easily count the number of 
weekdays between those two dates?


________________________________



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