Something like this would work:
With units AS
(
Select Distinct
unit
FROM
dbo.Full_Referrals_Dataset_live
)
SELECT
count(FR.[Unit]) as Actual,
U.unit,
FR.[1st_of_month],
FR.[last_of_month]
FROM
units as U LEFT JOIN
dbo.Full_Referrals_Dataset_live as FR
WHERE
FR.RfR1 = '18 month project'
GROUP BY
U.unit,
FR.[1st_of_month],
FR.[last_of_month];
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question