‎10-18-2018 10:52 AM
‎10-19-2018 06:09 PM
CONVERT(DateTime, CONVERT(VarChar(50), (@Year*10000 + @Month*100 + @Day)), 112)
DateAdd(dd,
-1*DatePart(dw, DATEFROMPARTS(DatePart(yyyy, DateAdd(mm, 1, GetDate())), DatePart(mm, DateAdd(mm, 1, GetDate())), 8-3) ),
DATEFROMPARTS(DatePart(yyyy, DateAdd(mm, 1, GetDate())), DatePart(mm, DateAdd(mm, 1, GetDate())), 1+7*2)
)
‎10-19-2018 05:55 PM
=DATE(@year, @month, 1+7*n) - WEEKDAY(DATE(@year, @month, 8-xday))
=DATE(@year, @month, 1+7*2)-WEEKDAY(DATE(@year, @month, 8-3))
CONVERT(DateTime, CONVERT(VarChar(50), (@Year*10000 + @Month*100 + @Day)), 112)
DateDiff(dd, -1*days, basedate)
DateAdd(dd,
-1*DatePart(dw, CONVERT(DateTime, CONVERT(VarChar(50), (DatePart(yyyy, DateAdd(mm, 1, GetDate()))*10000 + DatePart(mm, DateAdd(mm, 1, GetDate()))*100 + 8-3)), 112) ),
CONVERT(DateTime, CONVERT(VarChar(50), (DatePart(yyyy, DateAdd(mm, 1, GetDate()))*10000 + DatePart(mm, DateAdd(mm, 1, GetDate()))*100 + 1+7*2)), 112)
)
‎10-19-2018 01:35 PM
‎10-19-2018 01:18 PM
‎10-18-2018 05:42 PM
SELECT DATEFROMPARTS (@Year, @Month, @Day);otherwise,
SELECT CONVERT(Date, CONVERT(VarChar(50), (@Year*10000 + @Month*100 + @Day)), 112);
SELECT CONVERT(DateTime, CONVERT(VarChar(50), (@Year*10000 + @Month*100 + @Day)), 112);
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now