(order_depositmoneydate between '2012/10/1' and '2012/10/30' and order_ispay=2) group by CONVERT(varchar(10), order_depositmoneydate, 120 )
select count(*) counts2,CONVERT(varchar(10), order_payallmoneydate, 120 ) order_paydate from Ec_Order where
(order_payallmoneydate between '2012/10/1' and '2012/10/30' and order_ispay=3) group by CONVERT(varchar(10), order_payallmoneydate, 120 )
select * from (select count(*) counts1,CONVERT(varchar(10), order_depositmoneydate, 120 ) order_paydate from Ec_Order where
(order_depositmoneydate between '2012/10/1' and '2012/10/30' and order_ispay=2)
group by CONVERT(varchar(10), order_depositmoneydate, 120 )) a full join (select count(*) counts2,CONVERT(varchar(10), order_payallmoneydate, 120 )
order_paydate from Ec_Order where (order_payallmoneydate between '2012/10/1' and '2012/10/30' and order_ispay=3)
group by CONVERT(varchar(10), order_payallmoneydate, 120 )) b on a.order_paydate=b.order_paydate
select isnull(counts1,0)+isnull(counts2,0) sums,isnull(b.order_paydate,a.order_paydate) order_paydate from (select count(*) counts1,CONVERT(varchar(10), order_depositmoneydate, 120 ) order_paydate from Ec_Order where (order_depositmoneydate between '2012/10/1' and '2012/10/30' and order_ispay=2)
group by CONVERT(varchar(10), order_depositmoneydate, 120 )) a full join (select count(*) counts2,CONVERT(varchar(10), order_payallmoneydate, 120 )
order_paydate from Ec_Order where (order_payallmoneydate between '2012/10/1' and '2012/10/30' and order_ispay=3)
group by CONVERT(varchar(10), order_payallmoneydate, 120 )) b on a.order_paydate=b.order_paydate