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 |
|
kshitizgp
Starting Member
31 Posts |
Posted - 2012-01-01 : 11:37:19
|
| guyz i hardly have knwledge abt stored proc and i need help . plssi designing a form which would give me the report of employee work summary ..i am using (TO DATE ) AND from date using telerik so that employee when he selects the month ,he should get the summary of his work .how to use to date and from date in work date using if loop can u teme the exact thing ..am thking like if(work_date = start_Date and end_date>=work_date)begin select work_date as date , work_hours as Hours from employee where emp_id = @ emp_id and dep_id =@de_idelse ..what? plese guide meplease stored procedures are fking my brians |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-01-01 : 11:48:30
|
Perhaps better to use something like this?select work_date as date, work_hours as Hoursfrom employeewhere emp_id = @emp_id and dep_id = @de_id and work_date between start_date and end_date; |
 |
|
|
whatamouth
Starting Member
16 Posts |
Posted - 2012-01-02 : 04:51:13
|
| -- this will get the total no. of hours worked of certain emp_id during the date providedcreate procedure sproc_get_work_summary(@start_date smalldatetime, @end_date smalldatetime, @emp_id varchar(10))asbegin select SUM(work_hour) from employee where emp_id =@emp_id and work_date between @start_date and @end_dateend--hope it helpsNeil Matiasneilmatias@yahoo.com |
 |
|
|
|
|
|