Select newid() as Id, acKey, acName,  acSubject, acNote, acCurrency, anRoundExpenses from (
Select C.acKey, 'Kilometrina' acName,  I.acSubject, 'Kilometrina' acNote, C.acCurrency, SUM(C.anMileage) as anRoundExpenses from vHR_TrvlValueItem C
join tHR_TrvlItem I on I.acKey = C.acKey and I.anNo = C.anNo
Where C.anMileage > 0
Group by  C.acKey,  I.acSubject,  C.acCurrency                                        
Union all  
SELECT TOP 3 acKey, acName,  acSubject, acNote, acCurrency, anRoundExpenses FROM vHR_TrvlOtherCostItemValue C
WHERE IsNull(anTrvlType, 0) = 0
) Q
Where acKey = @acKey