hi all,
SELECT GEINFO_Routing_Party,COUNT((GEINFO_Routing_Party)) as routeCount,Trailer_Type_ID,count(Trailer_Type_ID) as cntTrailer,job_type,COUNT(job_type) as cntJob,Size,COUNT(Size) as cntSize
FROM MDT_JOB_MASTER_TABLE j
JOIN MDT_JOB_DETAILS_TABLE jd
ON j.JOB_Number = jd.JOB_Number
JOIN MDT_JOB_DETAILS_ASSIGN_TRACK_TABLE jt
ON jd.JOB_ORDER_DETAILS_NO = jt.JOB_ORDER_DETAILS_ID
WHERE jt.MDT_Function_Code='0108' and jd.JOB_TYPE_ACTIVITY='DEL' and j.GEINFO_Routing_Party=1036 and jt.Job_LastStatus_Date_Time between '2014-10-15 00:00:00' and '2014-10-15 23:00:00'
group by GEINFO_Routing_Party ,Trailer_Type_ID,job_type,Size
here is the o/p while running
GEINFO_Routing_Party routeCount Trailer_Type_ID cntTrailer job_type Size cntSize
1036 1 t1 1 export 20 1
1036 2 t2 2 export 40 2
1036 6 t3 6 Import 20 6
1036 1 t4 1 Import 20 1
but i need o/p as
Trailer_Type_ID job_type
t1 t2 export import
t1count t2count size size
20 40 20 40
count count count count
i want like the above in ssrs report
pls advice
that is like count no.of trailertype where trailertype_id=t1
that is like count no.of trailertype where trailertype_id=t2
that is like count no.of size=20 where job_type=export
that is like count no.of size=40 where job_type=export
that is like count no.of size=20 where job_type=Import
that is like count no.of size=40 where job_type=Import
by grouping one routing party that 1036
eg:
count no.of trailertype where trailertype_id=t1 =9
count no.of trailertype where trailertype_id=t1 =1
count no.of size=20 where job_type=export =6
count no.of size=40 where job_type=export=1
count no.of size=20 where job_type=Import=2
count no.of size=40 where job_type=Import=1
all into one row