LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2000, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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;


Back to: Top of message | Previous page | Main SAS-L page