Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
VB
case t.[Year]
      when year(GETDATE()) | (year(GETDATE())+1) isnumeric( t.[Year])
      then t.[Year]
      when  year(GETDATE()) & (year(GETDATE())+1)  isnumeric( t.[Year])
      then t.[Year]

      end



i wanted to compare and check when year(GETDATE()) | (year(GETDATE())+1) is equal to

isnumeric( t.[Year])


i want this to be in a case
Posted
Updated 20-Jun-13 0:22am
v2
Comments
Aarti Meswania 20-Jun-13 6:26am    
not clear in any case you want to return t.year?
what is your actual query?

1 solution

or is used like below in case
SQL
case When year(GETDATE())=t.[year] OR (year(GETDATE())+1) = t.[year] then t.[year]
     else year(GETDATE()) end

Happy Coding!
:)
 
Share this answer
 

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

  Print Answers RSS


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