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

📱Build WhatsApp Bot using .NET + OpenAI

   In this article, you will learn how to build a real-world WhatsApp chatbot using ASP.NET Core and OpenAI. This bot can automatically repl...