sql - Insert data in ssrs table in the query -


i insert data in ssrs table. show here:

enter image description here

how can add these data in query in ssrs. have no possibility change in database.

       | p1|p2 |p3 |p4 |p5 |p6 |p7 |p8 group a|84%|87%|81%|81%|79%|96%|86%|88% group b|66%|22%|79%|64%|53%|94%|5% |23% 

the problem is: last week on wednesday database did not recorded data group , group b. , have no possibility correct/add missing data in database. , thats why add these missed data in query , show in report.

my query:

select *     (     select   intervaldate datum ,tsystem.name name ,team group ,sum(goodunits) goods ,sum(theoreticalunits) units tcount inner join tsystem on tcount.systemid = tsystem.id  intervaldate >= @startdatetime , intervaldate <= @enddatetime     group intervaldate     ) c     inner join     (     select      sh.date datum,     sc.name name     thistory sh     inner join tschedule sc on (sc.id = sh.scheduleid)     scheduled != 0     ) p on p.name = c.name 

when realized data not recorded did written down data on paper.

to add manual data posted query, can use union all , values so:

first make sure 'additional data' correct on own. try example:

select datum,name,[group],goods,units ( values  (cast('2015-01-01' date),'aname','a',10.32,20.76), (cast('2015-01-01' date),'aname','b',12.72,16.15) ) extradata(datum,name,[group],goods,units); 

i making many assumptions here have not provided enough info in question.

anyway if correct, attach original data union all

select datum,name,[group],goods,units     (     select  intervaldate datum ,tsystem.name name ,team [group] ,sum(goodunits) goods ,sum(theoreticalunits) units tcount inner join tsystem on tcount.systemid = tsystem.id intervaldate >= @startdatetime , intervaldate <= @enddatetime     group intervaldate     ) c     inner join     (     select      sh.date datum,     sc.name name     thistory sh     inner join tschedule sc on (sc.id = sh.scheduleid)     scheduled != 0     ) p on p.name = c.name /* original query ends. add more data */ union select datum,name,[group],goods,units ( values  (cast('2015-01-01' date),'aname','a',10.32,20.76), (cast('2015-01-01' date),'aname','b',12.72,16.15) ) extradata(datum,name,[group],goods,units); 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -