The entry lock date is every month 10th
I want any date older than the entry date to be entered as a locked date in SQL server table
You need to check the Date using DATEPART function with GETDATE function.
Example:
DECLARE @Date DATETIME = '2022-12-10' SELECT CASE WHEN DATEPART(DD, @Date) <= 10 THEN 1 ELSE 0 END
Output
1
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.