datetime - Get Number of Weeks that have passed from a certain date to today SQL -
im trying design table column has total number of weeks have passed static, hardcoded date, until today. example, if today june 27, 2014, want find how many weeks have passed since may 31st, 2012; program here return 108 weeks.
most results have found have week counter roll on @ each new year, find keeps counting past 52.
im using sybase ase db if help.
you can use datediff function:
select datediff(wk, '2012-08-20', '2014-06-27');
Comments
Post a Comment