Hi @Bipin kumar
Year part is defaulted to 2296 for all the rows
the requirement is to get Next 7 days records from current date
You could replace the Year '2296' with current year '2022' first and then do a filter, like this:
SELECT * FROM TableC
WHERE REPLACE(dob,'2296',YEAR(GETDATE())) BETWEEN CONVERT(DATE, GETDATE()) AND CONVERT(DATE,DATEADD(DAY,6,GETDATE()))
Best regards,
LiHong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.