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 |
cheatasp
Starting Member
10 Posts |
Posted - 2009-05-19 : 01:58:28
|
Dear All,I have found problem with report that has group sectionBelow query is the groupdeclare @Department varchar(4)declare @JobType varchar(4)set @Department ='%'set @JobType='%'SELECT DISTINCT T.JobTypeID, T.JobTypeFROM TAB_JobPositionType AS T INNER JOIN TAB_JobPosition AS J ON J.JobTypeID = T.JobTypeIDINNER JOIN TAB_Employee AS E ON J.EmpID = E.EmpIDINNER JOIN TAB_Department AS D ON E.DepartmentID = D.DepartmentIDINNER JOIN TAB_Location AS L ON E.LocationID = L.LocationIDWHERE datediff(dd,PromotionDate,getdate())>=75 AND datediff(dd,PromotionDate,getdate())<=90AND J.JobTypeID LIKE @JobTypeAND E.ContractTypeID=1AND D.DepartmentID LIKE @DepartmentAnd below is the detaildeclare @Department varchar(4)declare @JobType varchar(4)set @Department ='%'set @JobType='%'SELECT DISTINCT E. EmpID,Name, PromotionDate,dateadd(day,90-datediff(dd,PromotionDate,getdate()),getdate()) As EndProbation,(90-datediff(dd,PromotionDate,getdate())) AS DayLeft, D.Department, L.Location FROM TAB_Employee AS EINNER JOIN TAB_JobPosition AS JON J.EmpID = E.EmpIDINNER JOIN TAB_Department AS D ON E.DepartmentID = D.DepartmentIDINNER JOIN TAB_Location AS L ON E.LocationID = L.LocationIDWHERE datediff(dd,PromotionDate,getdate())>=75 AND datediff(dd,PromotionDate,getdate())<=90AND JobTypeID LIKE @JobTypeAND E.ContractTypeID=1AND D.DepartmentID LIKE @DepartmentBut when I run report it show differnce group but the same detailplease help me |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-05-19 : 02:05:49
|
check your INNER JOIN. Make sure you specify all the columns in the foreign key in the ON KH[spoiler]Time is always against us[/spoiler] |
|
|
cheatasp
Starting Member
10 Posts |
Posted - 2009-05-19 : 02:29:26
|
Dear,In table detail has foreign key JobTypeID and table main has primary key JobTypeID .I inner join them already |
|
|
|
|
|
|
|