1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Rep Power

    Search on two values

    This one should be an easy one.

    How do you search a Column to return 2 values? For example, return ProjectName= 'Test Project 1' and ProjectName = 'Test Project 2'

    This is my current WHERE:
    WHERE (((MSP_EpmProject.ProjectName) Like '2013 CSX%' And (MSP_EpmProject.ProjectName) Like 'Administrative') AND ((MSP_EpmAssignmentByDay.TimeByDay)>='1/1/2013' And (MSP_EpmAssignmentByDay.TimeByDay)<='1/04/2014')))
    EDIT: I think I figured it out-- need to use Or?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Rep Power
    Instead of going the above route- I've decided to WHERE on a different field. However now I'm getting another error= "multi-part identifier MSP_EpmResource_UserView.Resource Departments could not be bound"

    SELECT [Assignment work by day].ProjectName
    	, [Assignment work by day].ResourceName
    	, [Assignment work by day].TaskName
    	, [Assignment work by day].TimeByDay
    	, [Assignment work by day].AssignmentWork
    	, [Assignment work by day].AssignmentActualWork
    	, [Timesheet 2013].ActualWorkBillable
    	, [Timesheet 2013].ActualOvertimeWorkBillable
    	, [Assignment work by day].[Resource Manager]
    	, [Assignment work by day].GroupManagerFullName
    FROM ( 
    	SELECT MSP_EpmProject.ProjectName
    	, MSP_EpmTask.TaskName
    	, MSP_EpmAssignmentByDay.TimeByDay
    	, MSP_EpmAssignmentByDay.AssignmentWork
    	, MSP_EpmAssignmentByDay.AssignmentActualWork
    	, MSP_EpmResource_UserView.ResourceName
    	, CSX_ResourceManager.[Resource Manager]
    	, CSX_GroupManager.GroupManagerFullName
    	FROM (CSX_GroupManager 
    	INNER JOIN CSX_ResourceManager ON CSX_GroupManager.[ResourceManagerFullName] = CSX_ResourceManager.[Resource Manager]) 
    	INNER JOIN (((MSP_EpmAssignmentByDay 
    	INNER JOIN (MSP_EpmAssignment 
    	INNER JOIN MSP_EpmResource_UserView ON (MSP_EpmAssignment.ResourceUID = MSP_EpmResource_UserView.ResourceUID) AND (MSP_EpmAssignment.ResourceUID = MSP_EpmResource_UserView.ResourceUID)) ON MSP_EpmAssignmentByDay.AssignmentUID = MSP_EpmAssignment.AssignmentUID) 
    	INNER JOIN MSP_EpmProject ON (MSP_EpmAssignmentByDay.ProjectUID = MSP_EpmProject.ProjectUID) AND (MSP_EpmAssignment.ProjectUID = MSP_EpmProject.ProjectUID)) 
    	INNER JOIN MSP_EpmTask ON (MSP_EpmProject.ProjectUID = MSP_EpmTask.ProjectUID) AND (MSP_EpmAssignmentByDay.TaskUID = MSP_EpmTask.TaskUID)) ON CSX_ResourceManager.[ResourceFullName] = MSP_EpmResource_UserView.ResourceName
    	WHERE ((((MSP_EpmResource_UserView.[Resource Departments])= 'CSX') AND ((MSP_EpmAssignmentByDay.TimeByDay)>='1/1/2013' And (MSP_EpmAssignmentByDay.TimeByDay)<='1/04/2014')))) AS [Assignment work by day] 
    	SELECT MSP_TimesheetResource.ResourceName
    	, MSP_TimesheetTask.TaskName
    	, MSP_TimesheetProject.ProjectName
    	, MSP_TimesheetActual.TimeByDay
    	, MSP_TimesheetActual.ActualWorkBillable
    	, MSP_TimesheetActual.ActualOvertimeWorkBillable
    	FROM MSP_TimesheetActual 
    	INNER JOIN ((MSP_TimesheetResource 
    	INNER JOIN (((MSP_TimesheetLine 
    	INNER JOIN MSP_TimesheetProject ON MSP_TimesheetLine.ProjectNameUID = MSP_TimesheetProject.ProjectNameUID) 
    	INNER JOIN MSP_TimesheetTask ON MSP_TimesheetLine.TaskNameUID = MSP_TimesheetTask.TaskNameUID) 
    	INNER JOIN MSP_Timesheet ON MSP_TimesheetLine.TimesheetUID = MSP_Timesheet.TimesheetUID) ON MSP_TimesheetResource.ResourceNameUID = MSP_Timesheet.OwnerResourceNameUID) 
    	INNER JOIN MSP_EpmAssignment ON (MSP_TimesheetResource.ResourceUID = MSP_EpmAssignment.ResourceUID) AND (MSP_TimesheetTask.TaskUID = MSP_EpmAssignment.TaskUID) AND (MSP_TimesheetProject.ProjectUID = MSP_EpmAssignment.ProjectUID)) ON MSP_TimesheetActual.TimesheetLineUID = MSP_TimesheetLine.TimesheetLineUID
    	WHERE ((MSP_EpmResource_UserView.[Resource Departments])= 'CSX')
    ) AS [Timesheet 2013] 
        ON [Timesheet 2013].ResourceName = [Assignment work by day].ResourceName 
       AND [Timesheet 2013].TimeByDay    = [Assignment work by day].TimeByDay   
       AND [Timesheet 2013].TaskName     = [Assignment work by day].TaskName    
       AND [Timesheet 2013].ProjectName  = [Assignment work by day].ProjectName

IMN logo majestic logo threadwatch logo seochat tools logo