I know we can convert a date into a certain Week Number in SQL, can we do the reverse ? Eg : I have Year, Month name and a week number like (2017,February,Week 2).
我知道我们可以在SQL中将日期转换为某个周数,我们可以反过来吗?例如:我有年,月名和一周数(如2017年,2月,第2周)。
Can we convert this into the first date of the week starting Sunday ? To give: 5-FEB-2017
我们可以将其转换为星期日开始的一周的第一个日期吗?给:5-FEB-2017
1 个解决方案
#1
1
select DATEADD(Day,weekNumber*7,[first day of month])
选择DATEADD(Day,weekNumber * 7,[第一天的第一天])
#1
1
select DATEADD(Day,weekNumber*7,[first day of month])
选择DATEADD(Day,weekNumber * 7,[第一天的第一天])