Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
mailtosaja
Starting Member
28 Posts |
Posted - 2008-08-25 : 03:43:15
|
| Hi,create procedure test@EmpID varchar(100),@JoinData DateTime,@EndDate DateTimeasselect * from Emp_Details where JoinDate between '7 Jun 2008' and '8 Jun 2008' and (@empId is null or Emp_id=@EmpID).....this is my sp..Here i got the correct out put...I would like to add some more Emp id in the condition,When @EmpID is null(for Example 101,103) ..If it is not null means we will match the condtion EmpID=@EmpId..if @empid is null means we will check with (101,103)otherwise empid=@empIdHow can i write the Query for that.... |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-25 : 03:46:07
|
| [code]create procedure test@EmpID varchar(100),@JoinData DateTime,@EndDate DateTimeasselect * from Emp_Details where JoinDate between '7 Jun 2008' and '8 Jun 2008' and ((@empId is null and Emp_id in (101,103,..))or Emp_id=@EmpID)[/code] |
 |
|
|
|
|
|