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();