Re: Computing Sequential Week Numbers Across Multiple Years

Posted by Art Kendall on
URL: http://spssx-discussion.165.s1.nabble.com/Computing-Sequential-Week-Numbers-Across-Multiple-Years-tp5740858p5740859.html

Untested may need tweaking.

if you mean calendar weeks
Datetime2 is your date.
Datetime1 is 1/1/2016.

compute TheWeek= 1+ trunc(DATEDIFF(datetime2, datetime1, “weeks”)).

if you mean weeks of service for a case
Datetime2 is date at end of service
Datetime1 is date at beginning of service

compute WeeksOfService= DATEDIFF(datetime2, datetime1, “weeks”).

Or do you mean weeks from start of service that some event takes place?
Art Kendall
Social Research Consultants