Sql Stored Procedure by date | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Sql Stored Procedure by date

I want to develop a Stored procedure for -Display a list of user and the total hour which spent on each day including day(e.g. Monday, TuesDay….) with date range. *Total hour calc base on Check In and Check out.
*Need to allow to set the Date From and Date To.
eg 2007-08-01 -> 2007-08-31. Query should display out 31 colum for each user and count the total hour spent on each day including day(e.g. Monday, TuesDay….). Can anybody help me to build this query. Regards
Ranjan

You have to post the table DDL, some sample data and the result that you want
[EDIT] OP has posted as new thread over herehttp://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=20350 KH
Actually format is like that. I want to develop a Stored procedure for -Display a list of user and the total hour which spent on each day including day(e.g. Monday, TuesDay….) with date range. Table name is : JobLog
fields are : JobNo, UserCode, CheckInDataTime, CheckOutDateTime
and I want the result on
*Total hour calc base on Check In and Check out.
*Need to allow to set the Date From and Date To.
eg 2007-08-01 -> 2007-08-31. Query should display out 31 colum for each user and count the total hour spent on each day including day(e.g. Monday, TuesDay….). Like Following Format :
————————————————————————
UserCode | Monday | TuesDay | Wednesday | Thursday | Friday | Saturday
| 08/01 | 08/02 | 08/03 | 08/04 | 08/05 | 08/06
————————————————————————
XXXXXX | 4 8 3 5 1 0 YYYYYY | 10 7 6 4 8 11
Like that. Can anybody help me to build this query/Stored Procedure? Regards
Ranjan

Duplicate posting…
I am locking this topic…
MohammedU.
Moderator
SQL-Server-Performance.com
]]>