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 |
basawareddy
Starting Member
11 Posts |
Posted - 2009-04-14 : 03:15:17
|
Hi Friends,I have written following query.select f.TestDesc,f.Totobs,f.Green,f.Yellow,f.red,prmDtls.tpd_field2,prmDtls.tpd_field3,prmDtls.tpd_field7,prmDtls.tpd_field8,prmDtls.tpd_field9,e.unitcode,e.Yellowcount,d.YellowRmarks,e.Redcount,d.RedRmarks--,e.TestCode,e.paramfrom (select * from [ConcatRemarks](@Units,@FromDate,@ToDate)) djoin(select * from [ConcatUnits](@Units,@FromDate,@ToDate)) e on (e.TestCode = d.TestCode and e.param = d.param)joinqc_test_parameter_detail prmDtls on ( e.param=prmDtls.tpd_code and e.testcode=prmDtls.tpd_test_code)right join(select th_description TestDesc,trd_test_code tstcode,th_sort_order,sum(trd_observations) TotObs,sum(trd_green) Green,sum(trd_yellow) Yellow,sum(trd_red) Redfrom qc_transaction_detail,qc_transaction_header,qc_test_headerwhere trd_unit_code in (select * from fnSplit(@Units,','))and trh_date >= @FromDate and trh_date <= @ToDateand trh_code=trd_trn_header_codeand trd_test_code = th_codegroup by th_description,trd_test_code,th_sort_order)f on e.testcode=f.tstcodeorder by f.th_sort_orderIt will return result as same asWater Treatment 217 217 0 0 NULLAdjunct Cooking 204 148 0 56 TEMPERATUREAdjunct Cooking 204 148 0 56 TOTAL GELATINISATION TIMEMilling and Mashing 416 387 0 29 TEMPERATUREBut i want in following manner.Water Treatment 217 217 0 0 NULLAdjunct Cooking 204 148 0 56 TEMPERATURE TOTAL GELATINISATION TIMEMilling and Mashing 416 387 0 29 TEMPERATUREPlz help me to solve.ThanksBasawareddy M Gopsen. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
basawareddy
Starting Member
11 Posts |
Posted - 2009-04-14 : 03:21:04
|
Hi Friends, Yes it is duplicate post but here i have mentioned correctly.appreciate your help.Thanks,Basawareddy |
|
|
|
|
|
|
|