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

Opps Part 1 : Abstraction

  Abstraction in C# is a fundamental concept of object-oriented programming (OOP) that allows developers t...