Wednesday, October 16, 2013

Date Condition in Case statement sql Server

SELECT
        C.CategoryID ,
        CategoryName ,
        CASE WHEN ABS(DATEDIFF(W,GETDATE(),R.CreatedDate)) <=THEN 'New' ELSE                         '' END AS 'NewReq' ,
        CategoryFolderName  
FROM Master.Catagory  C

No comments:

Post a Comment

Complete Authentication System in ASP.NET Core using JWT

JWT (JSON Web Token) authentication is widely used for securing APIs in modern applications. In this article, we will build a complete authe...