Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
SELECT DATEDIFF (DAY, @ID1ExpDate, GETDATE() + 1) AS DayDiff


I need to check that if result of this qurey is less then 90 then perform some thing. How can I perform check on it?
Posted
Updated 13-Sep-12 21:59pm
v2

1 solution

You can use CASE Statement.

SQL
SELECT CASE <variable> WHEN <value>      THEN <returnvalue>
                       WHEN <othervalue> THEN <returnthis>
                                         ELSE <returndefaultcase>
       END
FROM <table>


Here[^] is Case Statement documentation.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900