SQL Server - want to excess time entery from project web access 2003

Asked By sukesh adhikari
03-Dec-09 02:05 PM

hi

i want to extract the daily time entery submitted under all project in  project server 2003 by all resources.

the main thing in that is that    like in project web access if a resource is having the start date of a project  from

let says 8/15/2009  but if he is entering the time   under that project from  say 6/1/2009   so i want to get that time entery also....if this is possible it wud be a grt help

thanks

project server time entery problem  project server time entery problem

03-Dec-09 05:02 PM

hi

i want to extract the daily time entery submitted under all project in  project server 2003 by all resources.the main thing in that is that    like in project web access if a resource is having the start date of a project  from  says 8/15/2009  but if he is entering the time   under that project from  say  6/1/2009   so i want to get that time entery also....  below is the query i am using to view the results

select

r.proj_id As Proj_ID,

p.proj_name as Proj_Name,

r.res_name As Res_Name,

min( a.assn_start_date)work_start,

max(a.assn_finish_date) as Work_Till,

SUM(a.assn_work / 60000) AS Work,

SUM(a.assn_act_work / 60000) AS Actual_Work

from dbo.MSP_RESOURCES r

inner join dbo.MSP_PROJECTS p on

r.proj_id = p.proj_id

left outer join dbo.MSP_ASSIGNMENTS a on

r.proj_id = a.proj_id AND

r.res_uid = a.res_uid

where (r.res_uid >0)

and res_name ='sukesh adhikari'

group by p.proj_name,

r.proj_id,

r.res_name,

r.res_uid

order by p.proj_name

proj_id  proj_name   res_name   work_start      work_till           work         actual_work

341      Project1.   abc        2009-09-07      2011-07-29         7646.88        0.00
272      project2.   abc        2007-01-22      2008-10-16         2439.83        0.00
274      project2    def        2013-08-28      2014-01-20         826.683        0.00

 

so i am getting this output......the amount of work that have been alloted to me exactly matches the  work that is  shown in  project server   but   i am not getting the actual work done  correct.

and also like u can see the my work start date  for project1 in the project server is   09/07/2009

but i joined the company 2 month before that and i had been entering the time under that project1 2 months before the work start date  so it is not showing the actual work done under for that period under that project..

i hope u got what i am trying to say...any help in this matter will be highly appericiated thanks

 

Things to Check  Things to Check

06-Dec-09 04:15 AM

Here are a few things you can check:

- Give your res_uid, check against the MSP_Assignments table all records for your res_uid and see if all the entries you've entered before is still there.

- Make sure you are retrieving the correct field to calculate the actual work done.  Instead of the assn_act_work field, you may also look at the assn_reg_work field and assn_base_work field.

Regards,
http://www.sql-server-helper.com/sql-server-2008/sqlconnection-connection-string.aspx

got some hint about the data but having lil confusion  got some hint about the data but having lil confusion

06-Dec-09 11:26 AM

hi thanks for the reply ..

i am using the script below to pull the data....and it is showing me the amount of  work that i have done in that month...

but the thing is that for a single project it is showing me like 10-20 records  and with different Wres_id which i get from web_work table and when i look into those values , there i can find my one record for the month that i worked..

i was wondering why it is showing me too many  wres_id for single project for given time period..

plus this query is giving the data by month ...how can i get the data by per day ???

can you look into the query ...any help will be highly appericiated

thanks


create table #timesheet (  Resource int, Project int, Task int,   Period int, Hours dec(7,2))

----------------------------------------------------

-- insert into temp table

----------------------------------------------------

insert into #timesheet (  Resource, Project, Task, Period, Hours)

----------------------------------------------------

-- load timesheet data - account for start month

----------------------------------------------------

select  A.WRES_ID, C.PROJ_ID,

--B.TASK_ID,

B.TASK_UID,

                (year(A.WWORK_START) * 100) + month(A.WWORK_START),

                case when ((year(A.WWORK_START) * 12) + month(A.WWORK_START)) = ((year(A.WWORK_FINISH) * 12) +month(A.WWORK_FINISH))

                                then (((datediff(dd,A.WWORK_START,A.WWORK_FINISH) + 1) * A.WWORK_VALUE) / 60000)

                                else ((((datediff(dd,A.WWORK_START,A.WWORK_FINISH) + 1) - day(A.WWORK_FINISH)) *A.WWORK_VALUE) / 60000) end                   

from    LSREPOSITORY.ProjectServer.dbo.MSP_WEB_WORK A

                join LSREPOSITORY.ProjectServer.dbo.MSP_WEB_ASSIGNMENTS B

                                on      A.WRES_ID = B.WRES_ID AND B.WASSN_ID = A.WASSN_ID

                join LSREPOSITORY.ProjectServer.dbo.MSP_WEB_PROJECTS C

                                on      C.WPROJ_ID = B.WPROJ_ID

where   A.WWORK_TYPE = 1 and

                ((year(A.WWORK_START) * 12) + month(A.WWORK_START)) <= ((year(A.WWORK_FINISH) * 12) +month(A.WWORK_FINISH))           

union all

----------------------------------------------------

-- start and end in different months - account for to month

----------------------------------------------------

select  A.WRES_ID, C.PROJ_ID,

--B.TASK_ID,

B.TASK_UID,

                (year(A.WWORK_FINISH) * 100) + month(A.WWORK_FINISH) as Period,

                ((day(A.WWORK_FINISH) * A.WWORK_VALUE) / 60000) as Hours

from    LSREPOSITORY.ProjectServer.dbo.MSP_WEB_WORK A

                join LSREPOSITORY.ProjectServer.dbo.MSP_WEB_ASSIGNMENTS B

                                on      A.WRES_ID = B.WRES_ID AND B.WASSN_ID = A.WASSN_ID

                join LSREPOSITORY.ProjectServer.dbo.MSP_WEB_PROJECTS C

                                on      C.WPROJ_ID = B.WPROJ_ID

where   A.WWORK_TYPE = 1 and

                ((year(A.WWORK_START) * 12) + month(A.WWORK_START)) < ((year(A.WWORK_FINISH) * 12) +month(A.WWORK_FINISH))

---------------------------------------------------------

select distinct  Resource,Project, Task,  Period, sum(Hours)

from #timesheet

group by   Resource, Project,  Task,   Period

got the answer  got the answer
08-Dec-09 11:24 AM

thanks for reply

i got the amount of work done by  combining web_work and web_assignment table and using this expression

((datediff(dd,W.WWORK_START,W.WWORK_FINISH) + 1) * W.WWORK_VALUE) / 60000))

thanks

Create New Account
help
Keyword EXCEPT not working - SQL Server 2000 SQL Server Folks, Does the keyword EXCEPT work only in SQL Server 2005 and later versions? Thanks! J.S. SQL Server Programming Discussions SQL Server 2008 (1) SQL Server 2005 (1) SQL Server 2000 (1) INNER
Is ! = still used? SQL Server I have run into ! = in some old problematic stored procedures I am reviewing and I do not remember ever seeing it before. Is it still used? Using SQL Server 2005. Nancy L SQL Server Programming Discussions SQL Server 2000 (1) SQL Server 2005 (1) Informix (1) Oracle (1) Stored procedure (1) INNER JOIN
SQL Express: Failed Reinstall SQL Server Dear Setup Experts: I am trying to reinstall SQL Express after playing with it some. I uninstalled it, and now, it refuses to reinstall in the face. Any ideas what this log file means and how I can get SQL Express installed? I really do not want to have to reinstall my whole system. * ** ** Start of Log File Overall summary: Final result: SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup. Exit code (Decimal): -2068643839 Exit facility code: 1203
Query Help SQL Server SQL Server 2000 I have a stored procedure that builds dynamic SQL SELECT @sqlexec = 'SELECT '+@sql+' FROM tbl1 INNER JOIN tbl2 ON . . . . WHERE (1 = 1 ' + @FamAbs + 'and tbl1.col1 = ''M'' )' My goal is to not use #tmp because it lives only in scope of EXEC. Can anyone help me? SQL Server Programming Discussions SQL Server 2000 (1) Stored procedure (1) INNER JOIN (1) FamAbs (1
Problem with casting value under 64-bit sql server 2005 vs under32-bit sql server 2005 SQL Server Hello - I have a strange problem when casting value under 64-bit sql server 2005 vs under 32-bit sql server 2005. I got two servers. One has 32