Click here to Skip to main content
11,480,847 members (62,299 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
if count(issue) in project is 0
return 1
else if(count(issue)>0 and count(issue)<5)
return 0
else
return -1

I want to create function for above in sql...
Please tel me how to do
Posted 15-Feb-13 0:12am
Comments
Chris Reynolds (UK) at 15-Feb-13 5:25am
   
I answered this under your other question

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

 You can try this function
 create function Check_Issue()
  returns  int 
    As
      begin 
       Declare @count int 
       Declare @result int 
         select @count = count(issue) from project   --take value in one variable 
            if (@count = 0 )                          -- check in if loop   
             Begin 
               set  @result = 1
             End 
             else if (@Count > 0 and @count < 5)
               set  @result = 0
             else 
               set  @result = -1    
        return @result                               -- return value 
    End 
  
  Permalink  
v2

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 294
1 Richard MacCutchan 160
2 OriginalGriff 135
3 CHill60 130
4 CPallini 125
0 Sergey Alexandrovich Kryukov 8,184
1 OriginalGriff 7,586
2 Sascha Lefèvre 3,114
3 Maciej Los 2,491
4 Richard Deeming 2,335


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 15 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100