From a2326315a6e0b1d892c389f7ab03282666d74218 Mon Sep 17 00:00:00 2001 From: Chase Tucker Date: Wed, 12 Feb 2025 09:02:10 -0700 Subject: [PATCH] Only show approvals within last two years --- MesaFabApproval.API/Services/ApprovalService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MesaFabApproval.API/Services/ApprovalService.cs b/MesaFabApproval.API/Services/ApprovalService.cs index 8966420..5f35e21 100644 --- a/MesaFabApproval.API/Services/ApprovalService.cs +++ b/MesaFabApproval.API/Services/ApprovalService.cs @@ -221,7 +221,8 @@ public class ApprovalService : IApprovalService { queryBuilder.Append("join SubRoleCategory src on sr.SubRoleCategoryID=src.SubRoleCategoryID "); queryBuilder.Append($"where UserID={userId} and ItemStatus=0 and "); queryBuilder.Append($"(AssignedDate is not null and "); - queryBuilder.Append($"AssignedDate <= '{DateTimeOffset.Now.ToString("yyyy-MM-dd HH:mm:ss")}') and "); + queryBuilder.Append($"AssignedDate <= '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}' and "); + queryBuilder.Append($"AssignedDate > '{DateTimeOffset.Now.AddYears(-2).DateTime.ToString("yyyy-MM-dd HH:mm:ss")}') and "); queryBuilder.Append($"((CompletedDate >= '{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")}') or "); queryBuilder.Append($"(CompletedDate is null));"); string sql = queryBuilder.ToString();