Date: Mon, 16 Oct 2000 12:24:40 -0400
Reply-To: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject: Re: Calculating weeks and days
On Mon, 16 Oct 2000 11:59:35 -0400, Ellen Rains <ERains@NERI.ORG> wrote:
>I need to calculate the number of weeks and days between two dates. I am
>using the following code, but not getting the right results.
>
>
>weeks_days = round((date1-date2)\7),1.);
>
>
>Any suggestions???
>
>Ellen
yes: use the SAS function INTCK for that:
data test;
d1="09jan2000"d;
d2=today();
weeks=intck("week",d1,d2);
put weeks=;
run;
The "days between two dates are simply the difference:
days=d2-d1;
|