From 3820011006ee7be12180d36427d0b0e09f8bda21 Mon Sep 17 00:00:00 2001 From: Auldrin-Possa Date: Fri, 25 Jul 2025 15:14:36 +0100 Subject: [PATCH] TD-5611-Modified SQL query to hide retired self-assessment role profiles --- .../DataServices/SupervisorDataService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs b/DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs index e0218b3e55..dd435aa1e8 100644 --- a/DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs @@ -796,7 +796,8 @@ FROM CandidateAssessments AS CA WHERE (DelegateUserID = @delegateUserId) AND (RemovedDate IS NULL) AND (CompletedDate IS NULL))) AND ((rp.SupervisorSelfAssessmentReview = 1) OR (rp.SupervisorResultsReview = 1)) - AND (ISNULL(@categoryId, 0) = 0 OR rp.CategoryID = @categoryId)", new { delegateUserId, centreId, categoryId } + AND (ISNULL(@categoryId, 0) = 0 OR rp.CategoryID = @categoryId) AND + ((CAST(rp.RetirementDate AS DATE) >= CAST(GETUTCDATE() AS DATE)) OR rp.RetirementDate IS NULL)", new { delegateUserId, centreId, categoryId } ); }