sql查找日期的星期.开始的星期应该是星期六而不是星期日. [英] sql to find the week of the date.Starting week should be saturday not sunday.

查看:127
本文介绍了sql查找日期的星期.开始的星期应该是星期六而不是星期日.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过sql查找日期的星期.语法为
Week(''01/01/12'')将给我这个日期的星期.
如果iam执行此语法,则一周仅从星期日开始,但是我希望星期开始于星期六而不是星期日.
谁能帮我,如何将开始周的sql写为星期六而不是周日.

I would like find the week of the date thro sql. The syntax is
Week(''01/01/12'') will give me the week of this date.
If iam executing this syntax, the week starts from sunday only but i would like to have starting of the week should be Saturday not sunday.
Can any one help me, how to write the sql for the starting week as saturday not sunday.

推荐答案

您可以使用SET DATEFIRST将其设置为当天想.检查链接以获取更多信息.
http://msdn.microsoft.com/en-us/library/ms181598.aspx [ ^ ]

祝你好运!
You can use SET DATEFIRST to set it to the day you want. Check the link for more info.
http://msdn.microsoft.com/en-us/library/ms181598.aspx[^]

Good luck!


这篇关于sql查找日期的星期.开始的星期应该是星期六而不是星期日.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆