• Here's some sample data (which you should have posted) and a shorter version of your query.

    What should the results look like for this data?

    CREATE TABLE POSTING(

    POSTING_ID INT IDENTITY(1,1),

    CREATE_DATE DATETIME

    );

    INSERT INTO POSTING

    VALUES

    ('20140101'),

    ('20140201'),

    ('20140301'),

    ('20140401'),

    ('20140501'),

    ('20140101'),

    ('20150201'),

    ('20150211'),

    ('20150301'),

    ('20150311'),

    ('20150401'),

    ('20150411'),

    ('20150501'),

    ('20150511'),

    ('20150601'),

    ('20150711'),

    ('20160101'),

    ('20160111'),

    ('20160201'),

    ('20160211');

    SELECT *

    FROM POSTING;

    SELECT DATEADD(mm, DATEDIFF(mm, 0, CREATE_DATE), 0) AS THEDATE

    , YEAR(post.CREATE_DATE) AS THEYEAR

    , MONTH(post.CREATE_DATE) AS THEMONTH

    , STUFF(CONVERT( VARCHAR(11), post.create_date), 4, 4, '-') AS [Month-Year]

    , COUNT(DISTINCT post.POSTING_ID) AS POST_PERF

    FROM POSTING AS post

    WHERE post.CREATE_DATE >= '20150101'

    AND post.CREATE_DATE < '20160201'

    GROUP BY DATEADD(mm, DATEDIFF(mm, 0, CREATE_DATE), 0)

    , YEAR(post.CREATE_DATE)

    , MONTH(post.CREATE_DATE)

    , STUFF(CONVERT( VARCHAR(11), post.create_date), 4, 4, '-');

    GO

    DROP TABLE POSTING;

    Why are you using NOLOCK hints? Are you aware of the risks of bringing incorrect data?

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2