 		INNER JOIN [employer_financial].[PaymentMetaData] meta 
 			ON p.PaymentMetaDataId = meta.Id
 	WHERE  p.AccountId = @AccountId
-		AND DateCreated >= @FromDate 
-		AND DateCreated <= @ToDate
+		AND transLine.DateCreated >= @FromDate 
+		AND transLine.DateCreated <= @ToDate
 		AND p.FundingSource in (1,2,3)
 )
 , UniqueApprenticePaymentRecords -- This gets all the unique Account, Provider, Learner, PeriodEnd combinations

	tl.EmpRef,
	ld.PayrollYear,
	ld.PayrollMonth,
	LevyDeclared,
	EnglishFraction,
	tl.Amount - (LevyDeclared * EnglishFraction) AS TenPercentTopUp,
	tl.Amount
FROM [employer_financial].TransactionLine tl

			p.Ukprn, 
			p.Uln, 
			p.PeriodEnd, 
			p.PaymentId, 
			p.FundingSource, 
			p.Amount, 
			p.PaymentMetaDataId, 
			ptt.[Description] AS TransactionTypeDesc,
			meta.ProviderName AS TrainingProvider,
