Home > Software engineering >  SQL Sum (Case When statistical date
SQL Sum (Case When statistical date

Time:10-03

"Select processing, the Sum (Case When Id in (' 100 ') and Datediff (d, sdate, '" & amp; The Date & amp; "') & lt; 2 Then one else 0 end) as' & lt; Three days', the Sum (Case When Id in (' 100 ') and Datediff (d, sdate, '" & amp; The Date & amp; "')=2 Then one else 0 end) as'=3 days', the Sum (Case When Id in (' 100 ') and Datediff (d, sdate, '" & amp; The Date & amp; "') & gt; 30 Then 1 else 0 end) as'=3 days' From tb_AAAA treatment Group by "

In the database no & gt; The date of 30, all data is able to show, how to solve,
  • Related