0

Im trying to design a table with a column that has the total number of weeks that have passed from a static, hardcoded date, until today. For example, if the today is June 27, 2014, I want to find how many weeks have passed since May 31st, 2012; the program here would return 108 weeks.

Most results I have found have the week counter roll over at each new year, I would like to find something that keeps counting past 52.

Im using a SYBASE ASE db if that is any help.

jFram
  • 73
  • 3
  • 14

1 Answers1

4

You can use DATEDIFF function:

SELECT DATEDIFF(wk, '2012-08-20', '2014-06-27');

As described here or here:

Daniel Gadawski
  • 1,893
  • 4
  • 20
  • 32