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 |
|
genic
Yak Posting Veteran
57 Posts |
Posted - 2001-04-16 : 14:49:48
|
| ok, i do not want to create 6 store procedures for each case that i am going to have. i would like to have just one......here is an example of one sp that i am using. Alter Procedure sp_selectAllocatedHours_otd_date@date1 varchar(255),@date2 varchar(255),@profileorg varchar(255),@profiledept varchar(255),@profileteam varchar(255)Asselect sum(convert(decimal(10,4), b.hours)) as totalTime from profile as ainner join projecttime as b on (b.profileemail = a.profileemail)where b.workdate between @date1 and @date2and a.profile_org = @profileorgand a.profile_dept = @profiledeptand a.profile_team = @profileteamreturn now if @date1 and @date2 are null i would like to take out the where clause and do where a.profile_org = @profileorg ...etc...ALSOif @profileteam is null, i would like to exclude it from the query. same with @profiledept and @profileorg.anyone help with this? thank you |
|
|
|
|
|