简体   繁体   中英

SQL Server 2008 SSRS

Below is my DATA TABLE

Group RecvDate StartDate EndDate Status

d        7/1/2014                            Pending
d        7/2/2014     7/2/2014   7/2/2014    Completed
d        7/3/2014                            Pending
d        7/4/2014     7/4/2014   7/4/2014    Completed

![enter image description here][1] Now what i want do, I want count of status pending like below table.

Result Table:-

Group Date range Pending

d          7/1/2014        1
d          7/2/2014        1
d          7/3/2014        2
d          7/4/2014        2

I am new in SSRS. It will be so helpful if any one give me the concept on that.

Thanx in advance.

If I understood requirement correctly, you wanted to group by date and status.

Select col1, col2, case when col4='Pending' then 1 else 2 end as c
from t
group by 
col1, col2, case when col4='Pending' then 1 else 2 end as c

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM