the max thing was breaking up into quarters, but if you are just looking for the month, then populate the correct fields, you made it a lot harder than it needed to be
DDL
Summary
Create table #table1 (
[Fund Code] varchar(50)
, Class varchar(50)
, VaudationDate datetime
, FundBaseCurrency varchar(50)
, ClassCurrency varchar(50)
, SharesinIssue decimal(19,6)
, NavperShareinLocalCurrency decimal(19,6)
, NetAssetsinLocalCurrency decimal(19,6)
, Nav decimal(19,6)
, Shares decimal(19,6)
, Net decimal(19,6))
Insert Into #table1 ([Fund Code], Class, VaudationDate, FundBaseCurrency, ClassCurrency, SharesinIssue, NavperShareinLocalCurrency, NetAssetsinLocalCurrency)
Values ('MN-MNEM', 'Class A', '01/31/2019 23:59', 'USD', 'USD', '84471.81', '886.79', '886.79')
, ('MN-MNEM', 'Class A', '02/28/2019 23:59', 'USD', 'USD', '84471.81', '84471.81', '71952276.81')
, ('MN-MNEM', 'Class A', '03/29/2019 23:59', 'USD', 'USD', '84471.81', '861.76', '851.79')
, ('MN-MNEM', 'Class A', '04/30/2019 23:59', 'USD', 'USD', '55599.46', '836.17', '46490465.40')
, ('MN-MNEM', 'Class A', '05/31/2019 23:59', 'USD', 'USD', '49864.89', '823.05', '41041370.93')
, ('MN-EONE', 'Class A', '01/31/2019 23:59', 'USD', 'USD', '25000.00', '1011.70', '25292430.52')
, ('MN-EONE', 'Class A', '02/28/2019 23:59', 'USD', 'USD', '39826.57', '914.86', '36435824.32')
, ('MN-EONE', 'Class A', '03/29/2019 23:59', 'USD', 'USD', '75897.58', '954.71', '72460503.15')
, ('MN-EONE', 'Class A', '04/30/2019 23:59', 'USD', 'USD', '75897.58', '848.24', '64379042.81')
, ('MN-EONE', 'Class A', '05/31/2019 23:59', 'USD', 'USD', '75897.58', '857.11', '65052524.70')
, ('MN-EONE', 'Class A', '06/28/2019 23:59', 'USD', 'USD', '75897.58', '851.28', '64610299.45');
Query
Summary
;with cte as
( Select [Fund Code], Class, Count(1) as N
From #table1
Group By [Fund Code], Class)
update t
set Nav = Case When month(t.VaudationDate) = 1 and c.N = 6 then t.SharesinIssue End
, Shares = Case When month(t.VaudationDate) = 2 and c.N = 6 Then t.NavperShareinLocalCurrency End
, Net = Case When month(t.VaudationDate) = 3 and c.N = 6 Then t.NetAssetsinLocalCurrency End
From cte c
join #table1 t
on c.[Fund Code] = t.[Fund Code]
and c.Class = t.Class
select * from #table1