[英]Get Number of Weeks that have passed from a certain date to today SQL
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;
例如,如果今天是2014年6月27日,我想找出自2012年5月31日起已经过去了几周; the program here would return 108 weeks.
该程序将返回108周。
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. 我发现的大多数结果都在每个新年都有星期计数器,我想找到一些可以超过52的东西。
Im using a SYBASE ASE db if that is any help. 我正在使用SYBASE ASE数据库,如果有帮助的话。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.