MS Project 2010: SQL Query Expansion to custom field

In a further forum topic I got the solution for searching for server admins approvals pending, not publisched projects and team members not sended times.
We defined a new enterprise custom field called "Status reporting" from type Flag (yes/no).
Can someone help me to expand the following MS SQL query get the state of "Status Reporting" in the solution table?
SELECT DISTINCT  R.RES_NAME as [RESOURCE NAME], RB.RES_NAME STATUS_MANAGER, P.PROJ_NAME,A.TASK_NAME,
[STATUS] = Case TR.ASSN_TRANS_ACTION_ENUM When 0 Then
'Pending' When 1 Then 'Accepted' When 2 Then 'Rejected' End,
IS_PUBLISHED = CASE WHEN P.WPROJ_LAST_PUB >TR.ASSN_TRANS_SUBMIT_DATE THEN 'Yes' ELSE 'No' END,
TASKSTATUS = CASE WHEN AU.ASSN_UID IS NULL AND TR.ASSN_TRANS_ACTION_ENUM = 0 THEN 'Saved' ELSE 'Submitted' END,
BASELINED = CASE AB_BASE_NUM WHEN 0 THEN 'Yes' ELSE 'No' END
 FROM MSP_ASSIGNMENT_TRANSACTIONS TR WITH(READPAST)
LEFT OUTER JOIN dbo.MSP_CONVERSIONS C ON ((C.CONV_VALUE =
TR.ASSN_TRANS_ERROR_ENUM) AND (STRING_TYPE_UID = 'A16A340A-4AD1-4F62-880C-564C45021502'))
LEFT OUTER JOIN MSP_ASSIGNMENTS_SAVED A WITH(READPAST) ON TR.ASSN_UID = A.ASSN_UID
LEFT OUTER JOIN MSP_ASSIGNMENTS_SUBMITTED AU WITH(READPAST) ON TR.ASSN_UID = AU.ASSN_UID
LEFT OUTER JOIN MSP_ASSIGNMENT_BASELINES AB WITH(READPAST) ON TR.ASSN_UID = AB.ASSN_UID AND AB.AB_BASE_NUM = 0
LEFT OUTER JOIN MSP_PROJECTS P ON A.PROJ_UID = P.PROJ_UID
LEFT OUTER JOIN MSP_TASKS_SAVED TA ON TR.TASK_UID = TA.TASK_UID
LEFT OUTER JOIN MSP_PROJECT_RESOURCES R ON A.RES_UID = R.RES_UID AND R.PROJ_UID = P.PROJ_UID
LEFT OUTER JOIN MSP_PROJECT_RESOURCES RD ON
TR.ASSN_TRANS_DELEGATEE_RES_UID = RD.RES_UID AND P.PROJ_UID = RD.PROJ_UID
LEFT OUTER JOIN MSP_RESOURCES RD1 ON TR.ASSN_TRANS_DELEGATEE_RES_UID = RD1.RES_UID
LEFT OUTER JOIN MSP_PROJECT_RESOURCES RS ON
TR.ASSN_TRANS_SUBMITTER_RES_UID = RS.RES_UID AND P.PROJ_UID = RS.PROJ_UID
LEFT OUTER JOIN MSP_RESOURCES RS1 ON TR.ASSN_TRANS_SUBMITTER_RES_UID = RS1.RES_UID
LEFT OUTER JOIN MSP_RESOURCES RA ON TR.ASSN_TRANS_APPROVER_RES_UID = RA.RES_UID
LEFT OUTER JOIN MSP_RESOURCES RB ON A.WRES_UID_Manager = RB.RES_UID
LEFT OUTER JOIN PS_TestFarm01__Prodcp20130606_Reporting.dbo.MSP_EpmResource mer on A.WRES_UID_Manager=mer.ResourceUID
Murol

Hello Paul,
great, it works. I inserted:
Statusreporting =
CASE PV.[Status
Reporting] WHEN 1
THEN
'Yes'
ELSE
'No'
END
LEFT OUTER JOIN PS_TestFarm01__Prodcp20130606_Reporting.dbo.MSP_EpmProject_UserView PV
ON PV.ProjectUID = P.Proj_UID
The first line I understand a little bit but I don't understand 
PV.[Status Reporting]
But, the second line "LEFT OUTER ...", I doesn't understand
Many thanks and kind regards
Peter
Murol

Similar Messages

  • Deploy project using sql query

    hi
    i am trying to deploy project in ssis catalog using below query.
    Exec
    catalog.deploy_project@folder_name
    =@folder,@project_name
    =@ProjectName,@Project_Stream
    =@ProjectBinary,@operation_id
    =@operation_id
    out
    getting error:
    (1 row(s) affected)
    Msg 27203, Level 16, State 1, Procedure deploy_project, Line 139
    Failed to deploy project. For more information, query the operation_messages view for the operation identifier '51564'.                                                                                                                                                                                                                 
    also when i m trying to opne ispac file , i am getting error :
    TITLE: Failed to launch the wizard
    To launch the Integration Services Deployment wizard, one of the components: Integration Services, Management Tools - Basic or Business Intelligence Development Studio has to be installed by the SQL Server 2012 Standard, Enterprise, Developer, or Evaluation
    Edition. To install a component, run SQL Server Setup and select the component name.
    BUTTONS:
    OK
    is this 2 are related,how to solev it

    Which version of SQL Server are you using? Are you deploying to a server with multiple instances of SQL Server installed? Are you deploying the packages to different server?
    if so does the destination server has Integration services installed ?
    Deploying from the command line. In most large organizations, deployments are done by a DBA or systems administrator. In such environments, it's a great practice to use deployment scripts as much as possible to make the deployments
    more manageable as the number of SSIS packages increases. In SQL Server 2012, you can deploy SSIS packages using the command-line tool ISDeploymentWizard.exe. This tool works with the .ispac file, which is created in the project's BIN directory when you build
    the project in SQL Server Data Tools. The .ispac file for a project typically contains the following:
    The project's manifest
    All the packages belonging to the project
    The parameter file (Project.params)
    If you want to see the file's contents, you can change the extension from .ispac to .zip, then open it in Windows Explorer.
    To deploy the Test_Project project from the command line, you first need to copy the .ispac file to a shared folder. Then, in a Windows command shell, navigate to the folder containing the .ispac file and execute this ISDeploymentWizard command:
    "%ProgramFiles%\Microsoft SQL Server\110\DTS\Binn
      \isdeploymentwizard.exe" /S /ST:File
      /SP:Test_Project.ispac /DS:<SQL Server Instance Name>
      /DP:/SSISDB/MyTest/Test_Project

  • Need to find the assets associated to a BCC project using SQL query

    Hi,
    Given a BCC project (project_id), I need to find the assets (type of asset, version, status etc) in that project using SQL queries.
    I need this for reporting purpose and cannot do this programatically using any code.
    Surprisingly ATG does not store this association in a direct way. Can someone provide me the query if you have already done this before?
    I tried enabling loggingDebug in PublishingRepository and VersionManagerRepository to get the queries, but I did not get what I want.
    Thanks in advance,
    Gopinath Ramasamy

    UPDATE:
    When a project is selected in BCC, ATG is doing something crazy, as it appears to me, of querying all the tables (ofcourse when there is a cache miss) in all the versioned item descriptor with the workspace id of the project to display the assets contained in it.
    I do not see an easy or direct way of coming up with a query for this requirement.
    Please let me know if anyone has any other idea.
    Thanks,
    Gopinath Ramasamy

  • Why does Oracle SQL query returning a date field without the time component

    Hi,
    I'm a novice SQL user & hv just installed Oracle SQL developer (Version 3.0.04, Build MAIN-04.34).
    I made the same SQL query using "Oracle SQL developer" & "TOAD for Oracle 9.0.1" but I got 2 different format on the same date field:
    On TOAD, I get the date field extracted as *04/26/2011 23:12:58*
    On Oracle, I get the date field extracted as *26/APR/11*
    Why is the Oracle result in a different format & missing the time component?
    Is there any option/preference that I need to set in Oracle SQL developer to get the full date/time format displayed?
    I've tried to set my the date format to DD/MON/RR HH12:MI:SSXFF AM under the preference -> database NLS but I still get the same format!
    Plse help!

    hokim wrote:
    Hi,
    I'm a novice SQL user & hv just installed Oracle SQL developer (Version 3.0.04, Build MAIN-04.34).
    I made the same SQL query using "Oracle SQL developer" & "TOAD for Oracle 9.0.1" but I got 2 different format on the same date field:
    On TOAD, I get the date field extracted as *04/26/2011 23:12:58*
    On Oracle, I get the date field extracted as *26/APR/11*
    Why is the Oracle result in a different format & missing the time component?
    Is there any option/preference that I need to set in Oracle SQL developer to get the full date/time format displayed?
    I've tried to set my the date format to DD/MON/RR HH12:MI:SSXFF AM under the preference -> database NLS but I still get the same format!
    Plse help!http://edstevensdba.wordpress.com/category/nls_date_format/

  • Project Settlement - Aggregating/Settling on new custom field

    At our company, we created a new custom field called "Location Code" that is populated during journal entries through manual input. When an entry to a WBS element is posted with a Location Code value entered, the Location Code value also gets carried over to CO (controlling), SPL, and is in PS. The problem we have is with settlement as it does not carry over the Location Code at the final settlement receiver. For example:
    1. Journal entry is posted to WBS element H01.12345.01.01 with Location Code value entered of "435" (this is a field in the FI document posting screen) for $100. Another entry is posted to the same WBS element but with a different Location Code of "080" for $200. Both entries to the same G/L account.
    2. Settlement is run to settle the 2 entries in Step 1 above which totals ($200 + $100) $300. WBS element H01.12345.01.01 will settle to a cost center.
    3. When we view the final accounting documents (especially our special ledger purpose documents), Location Code value is blank and there is one entry to the receiving cost center for $300. It seems project settlement aggregates entries based only on WBS level and G/L account.
    QUESTION: Is it possible (and if so, how) to get projects to settle these lines individually based on aggregating on Location Code as well as G/L account? We would like to see $200 settle to the receiving cost center with Location Code value "435", and another line settling $100 to the receiving cost center with Location Code "080".
    I hope I made sense. Thanks in advance!

    line item settlement should only be possible if the setting is maintained in the IM Profile and it sounds like your projects don't have an IM profile...  so it shouldn't work.  I haven't used it on a non-capital project but you could give it a shot.
    [-nathan|http://wiki.sdn.sap.com/wiki/display/profile/Nathan+Genez]

  • Handling DST in SQL Query for UCCX Custom Report

    We wrote all custom reports for one of the call centers using our UCCX deployment.  One problem we see we will hit in the future is DST.  We suggested they use UTC but they wanted to see the call data based off of EST timezone.  Right now we are okay because we use -5 to get the correct data but come March we are wondering how to address the issue.  What options do we have?  How are other people handling DST with the SQL queries for custom reporting?  I see that the HR client will determine this based off of the local computer time then gives you the option to use UTC.  We have all of our queries in an Excel document that the customer just needs to open and select Refresh All to update their data.
    Thanks

    "case-when" statements are evaluated in order.
    so you must do something like this:
    SELECT
    CASE WHEN <is not number>THEN 'N'
    CASE WHEN <is greater than 0>THEN 'Y'
    Now "<is greater than 0>" will always have number for input, can't get "not number" error there.
    See this thread:
    Re: regular expression: integer is between N..M
    Edited by: CharlesRoos on May 27, 2010 5:03 AM

  • CR VS 2010 SQL query issue

    Hi all
    I'm facing a problem with my code.
    Dim cr As New CrystalReport1()
    Dim newCmd As SqlCommand
    Dim conn As SqlConnection
    Dim da As New SqlDataAdapter
    Dim ds As New DataSet
    Dim cr As New CrystalReport1
    Dim MyConnectionStr As String = "Data Source=MyDB;Initial catalog=MyCat;Integrated Security=true;" ' providerName=System.data.sqlClient"
    conn = New SqlConnection(MyConnectionStr)
    Dim cmdText As String
        cmdText= " SELECT customer.customer_name, customer.customer_tel, orders.order_stuff_name, orders.order_number" & _
    " FROM   hesabres.dbo.orders orders inner JOIN hesabres.dbo.customer customer ON orders.order_customer_id=customer.customer_id"
    da = New SqlDataAdapter(newCmd)
    da.fill(ds)
    cr.SetDataSource(ds.Tables(0))
    crystalviewer1.ReportSource = cr
    conn.Close()
      newCmd.Dispose()
    if i run the query, let's say it returns 2 rows
    I my CR veiwer, it shows 4 rows  (duplicates 2 x 2),
    if the query returns 3 rows, CR displays 9 rows (3 x 3) and so on 10 (10x10)....
    How is it possible??
    In my Dataset, the number of rows is always correct!
    Do you have any idea?
    Thanks in advance.
    B.

    See this wiki on how to troubleshoot issues with CR and datasets:
    Troubleshooting Issues with VS .NET Datasets and Crystal Reports - Business Intelligence (BusinessObjects) - SCN Wiki
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center
    Canada
    Follow us on Twitter

  • Query on adding custom fields of the BP Screen

    Hi Group,
    I have a requirement to add a couple of new fields to <b>BP</b> screen.
    I came to know that, <b>EEWB</b> is not a recommended way of doing this, as if some error occurs it is difficult to revert back.
    And also, <b>BDT tool</b> also cannot be a useful solution as the proposed requirement cannot be achieved.
    So other than the 2 ways, is there any other way through which I can achieve my requirement?
    Thanks in advance.
    Regards,
    Vishnu.

    is that BP screen in PCUI  ? or in SAP-GUI ?
    do clarify
    Regards,
    Raviraj

  • Custom field changes in Project 2010

    Is there a last-modified-date indicator in one of the databases to indicate when a custom field was changed? For example, I want to know when a custom field called project-phase (not workflow) has changed from one value to the next within a PDP. 
    The purpose is to produce a report that indicates the progression of a project from one phase to the next (plan-analyze-design, etc.).

    this question is closed - but for what you asked for the basic query provided  gave you the custom field modified date which would be more precise then the project modified date - 
    The below query will get you the information you want
    YOU put in the project GUID  OR the GUID of the Custom Field and this will return the tasks and project name it will also show you the difference (at least it did in my DB) the project modified data versus the task/custom field modified date which is
    also what you asked for...
    USE ProjectSevrerDraft
    SELECT
    mscf.MD_PROP_NAME as "Custom Field",
    mstcv.MD_PROP_ID as "MD PROP ID - can remove",
    proj.PROJ_NAME as "Project Name",
    proj.MOD_DATE as "Project Modified Date",
    mst.TASK_NAME as "Task Name",
    mstcv.CREATED_DATE as "Task Created Date",
    mstcv.MOD_DATE as "Task Modified Date"
    FROM MSP_TASK_CUSTOM_FIELD)VALUES mstcv
    JOIN MSP_PROJECTS proj
    ON mstcv.PROJ_UID=proj.PROJ_UID
    JOIN MSP_TASKS mst
    ON mstcb.TASK_UID=mst.TASK_UID
    JOIN [ProjectServerPublished].[dbo].[MSP_CUSTOM_FIELDS] mscf
    ON mscf.MD_PROP_ID=mstcv.MD_PROP_ID
    -- You can select either below un-comment out the '--'
    -- And insert what you want - the project or Custom field
    -- GUID will help. The PROJ_UID is found under MSP_PROJECTS
    -- THE MD_PROP_ID is found under the published database in
    -- the MSP_CUSTOM_FIELDS table
    --WHERE mstcv.PROJ_UID =' GUID OF PROJECT'
    --WHERE mstcv.MD_PROP_ID = 'GUID OF CUSTOM FIELD'

  • Customer details SQL Query

    Hi All,
    I need an sql query which shows customer details as follows: Customer party id, customer name, customer account id, customer account number, party site number, address1, address2, city, country, customer contact phone number. I developed the below query but it shows lot of repeated records with incorrect party site number.
    Please assist.
    SELECT hp.party_id,hp.party_name customer_name,hcp.phone_number,cust.account_number, hps.party_site_number, hl.ADDRESS1, hl.address2, hl.address3, hl.city,hl.country--, hp.person_first_name first_name, hp.person_last_name last_name
    FROM
    hz_parties hp,
    hz_relationships hr,
    hz_parties h_contact ,
    hz_contact_points hcp,
    hz_cust_accounts cust,
    hz_party_sites hps,
    hz_locations hl
    where hr.subject_id = h_contact.PARTY_ID
    and hr.object_id = hp.party_id
    AND hcp.owner_table_id(+) = hr.party_id
    AND cust.party_id = hp.party_id
    AND hcp.owner_table_id = hps.party_id(+)
    AND hps.location_id = hl.location_id
    AND hcp.CONTACT_POINT_TYPE ='PHONE'
    AND hcp.STATUS = 'A';

    Hi,
    Looks like some of your joins are incorrect. Try the below query :
    SELECT hp.party_id, hp.party_name customer_name, cust.account_number,
           hps.party_site_number, hl.address1, hl.address2, hl.address3, hl.city,
           hl.country, hcp.phone_number
      FROM hz_parties hp,
           hz_cust_accounts cust,
           hz_party_sites hps,
           hz_locations hl,
           hz_contact_points hcp
    WHERE cust.party_id = hp.party_id
       AND hp.status = 'A'
       AND cust.status = 'A'
       AND hps.party_id = hp.party_id
       AND hps.status = 'A'
       AND hl.location_id = hps.location_id
       AND hcp.owner_table_name = 'HZ_PARTIES'
       AND hcp.owner_table_id = hp.party_id(+)
    Regards,
    Manjusha.

  • Validation of Enterprise Customer Fields in Project Creation Page

    I want to do the validation on the Enterprise Custom Fields of PWA site for Project center. A set of custom fields have been added on the Project Creation Page.
    Custom Business Validation (such as a field value should be unique or based on another field) is required for some custom fields. This validation is required on clicking Save button in Project Creation Page of Ms Project Server 2010. The validation ought
    to be done on clicking "Save" button.
    Any help in this regard would be apppreciated.

    The link mentioned by you ToonS is not acessible.
    Here is the link:
    http://msdn.microsoft.com/en-us/library/office/gg615466(v=office.14).aspx
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Missing values of Enterprise Custom Field in Project Professional and Project Web Access

    Hi all,
    In Project Server 2010 SP2 we created a custom field called Iteration Path (without a lookup table).
    We're in an environment where Project Server task data gets synched from TFS and we've mapped the Iteration Path from TFS to the Enterprise Custom Field in Project Server.
    We've triggered synch of all synchronized work items from TFS to Project Server
    Then, in the database we can see the Iteration Path values coming across
    When I open these projects in Project Profssional, the entire column of Iteration Path is empty.
    When I open these projects in Project Web App (from Project Center), the entire column of Iteration Path is empty.
    When I open the master project which contains all these projects, no values are shown.
    Any ideas what can be wrong?
    I did already clear my cache, global.mpt, but nothing changed. We don't have this issue with other Enterprise Custom Fields that are mapped to TFS fields.
    Cheers,
    Bram
    www.projectexpert.nu

    Hi Bram,
    In the 4th item, when you say "database", which one are you talking about? Project Server DB? Draft or reporting DB? 
    If the value are not showing up in Project Pro, it is no need to clean your cache, since the value are obviously not stored in the Project Server Draft DB. The issue is more likely to come from the TFS sync for this particular field. Do you have any logs
    for the sync process? If your field in anyway different from the others, containing specific characters?
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • Need Suitable Pure SQL Query

    Hi
    I have Pure SQL DataBase name of Table as per given Coloumn Name.
    User Name StartDate EndDate
    Mr.Jack 01/04/2010 05/04/2010
    Mr.Perlin 07/04/2010 10/04/2010
    Mr.Tinklin 01/05/2010 05/05/2010
    Mr.Kerlin 12/04/2010 15/04/2010
    Now I am using asp.net Form Using C#...
    Name --> TextBox
    StartDate -> TextBox
    EndDate --> TextBox
    Now User enter the Dates after Click Save Button....
    Here SQL Query Check Whether the User Dates Clause into Data Base Date's.
    For Examble..
    User Enter Start Date = 04/04/2010, EndDate =08/04/2010
    Now Query it check SQL DataBase, Already 01/04/2010 to 10/04/2010 Available so Dont allow Save.... only allow various dates...
    ---------------- This is task Condition -------
    i am using SQL Query
    DECLARE @StartDate DATETIME
    DECLARE @EndDate DATETIME
    SET @StartDate ='02/04/2010' --// This is User Start Date coming from Text Box
    SET @EndDate = '10/04/2010' --// This is User End Date coming from Text Box
    IF NOT EXISTS (SELECT PollID FROM Polls WHERE (StartDate<= CAST (CONVERT(VARCHAR,@StartDate,101) AS DATETIME) OR EndDate <= CAST (CONVERT (VARCHAR,@EndDate,101) AS DateTime)) AND STATUS<>'D')
    SELECT 'OK ALLLOW'
    ELSE
    SELECT 'NOT ALLOW'
    But it is not working Correctly....
    Pls give some correctful query for solve task Condition
    By
    Riyaz
    Edited by: 798225 on Sep 28, 2010 10:37 PM
    Edited by: 798225 on Sep 28, 2010 10:52 PM

    Now I am developing Polls Application in asp.net
    I am using Polls Concept,
    DateBase Name : Polls
    Fields : PollID          PollName                           StartDate                                     EndDate                     UserID
    In Asp.Form Having
    User Name :  TextBox
    PollName: TextBox
    StartDate: TextBox
    EndDate: TextBox
    Submit - Button
    Task Details
    Whenever User Click after fillup all data's... then SQL Query Check
    if StartDate or EndDate is exists in Between DataBase Date's.....
    Condition true means dont allow save.. else Save.....
    Examble:
    PollID PollName StartDate EndDate UserName
    01 Sample 23/09/2010 26/09/2010 Klit
    02 Sample 2 29/09/2010 30/09/2010 Jack
    Now User given follwing details and click Submit,
    User Name : James
    PollName: Test
    StartDate: 22/09/2010
    EndDate: 27/09/2010
    Submit - Button
    Here User StartDate: 22/09/2010 , EndDate: 27/09/2010
    SQL Query Check ,
    Condtion 1 : Those dates are avilable in Datebase???
    Result: Yes
    Because, Sample Poll date is 23/09/2010 to 26/09/2010, here Start Date is Not Exists, But End Date Exists.
    So dnt allow Save Operation....
    Now User Again given follwing details and click Submit,
    User Name : James
    PollName: Test
    StartDate: 27/09/2010
    EndDate: 28/09/2010
    Submit - Button
    Here User StartDate: 27/09/2010 , EndDate: 28/09/2010
    SQL Query Again Check ,
    Condtion 1 : Those dates are avilable in Datebase???
    Result: No
    Because, Sample Poll date is 23/09/2010 to 26/09/2010,
    Sample1 Poll Date is 29/09/2010 to 30/09/2010
    here Start Date is Not Exists, But End Date Not Exists.
    So Allow Save Operation....
    This a My Task....
    Could You give SQL Query for help to Check given condition??
    regd
    Riayz
    Edited by: Riyaz on Sep 30, 2010 1:08 AM

  • Custome Fields in project

    Hi,
    In our Project Server config 2003 . We are using MSP_TEXT_FIELDS with TEXT_FIELD_ID = '188744741' to capture project ID. Ideally this table should have single entry for each project. For couple of projects the entry is more than one.
    I understand that this is because of Custom Field in Project , but I am unable to find out those field as this is not required.
    Can anyone help with database query to fetch custom fields.
    Thanks in advance.

    Please check the your custom fields are added in Coding Block or not. Then these field must appear in the Addition Assignment section of the field status group.
    Regards,
    Gaurav

  • Filter Project Server custom field based on current user?

    I've got a Project Server 2013 custom field, and I'd like to create a view that only shows me projects where the value in that custom field equals the current user. Simply put: I'm trying to find functionality similar to the [Me] filter in SharePoint.
    Apparently, simply using [Me] doesn't work. How can I fix this?

    I am trying to do something similar. were you able to find a solution to this? I am assuming no. 
    Parthiv Bhuta . Consultant

Maybe you are looking for