Viewing 15 posts - 556 through 570 (of 1,468 total)
retired
Reinstated
Please don't double post.
Further responses are available on https://www.sqlservercentral.com/forums/topic/count-of-entries-grouped-by-month-extracted-from-a-date
You need to add a GROUP BY
SELECT DATENAME(MONTH, CAST(RecvdDate AS Date)) + ' ' + CONVERT(varchar(10), YEAR(CAST(RecvdDate AS Date))) AS 'MonthName'
...
Your function is a scalar function, which has terrible performance.
Below is an iTvf (inline table valued function) that will get the last business day
CREATE FUNCTION [dbo].[F_PreviousBusinessDay]
(
@DateInput DATE
)
/*...
Viewing 15 posts - 556 through 570 (of 1,468 total)