--统计从2017年3月份开始每个月金融服务支付前分期申请数以及通过(核账完成)数
SELECT cast(datepart(year,DATEADD(DAY,-10,ApplyTime)) as varchar)+'年'+cast(datepart(month,DATEADD(DAY,-10,ApplyTime)) as varchar)+'月' as 日期,count(*) as 申请数 ,sum(MoneyCheckStatus) as 通过数
from LoanApply where ApplyTime>'2017-03-10 00:00:00'and ApplyTime<'2019-01-10 00:00:00' and BusinessType=0
group by year(DATEADD(DAY,-10,ApplyTime)),month(DATEADD(DAY,-10,ApplyTime)) --统计从2017年3月份开始每个月金融服务支付前分期申请数
SELECT cast(datepart(year,DATEADD(DAY,-10,ApplyTime)) as varchar)+'年'+cast(datepart(month,DATEADD(DAY,-10,ApplyTime)) as varchar)+'月' as 日期,count(*) as 申请数
from LoanApply where ApplyTime>'2017-03-10 00:00:00'and ApplyTime<'2019-01-10 00:00:00' and BusinessType=0
group by year(DATEADD(DAY,-10,ApplyTime)),month(DATEADD(DAY,-10,ApplyTime)) --统计从2017年3月份开始每个月金融服务支付前分期通过(核账完成)数
SELECT cast(datepart(year,DATEADD(DAY,-10,ApplyTime)) as varchar)+'年'+cast(datepart(month,DATEADD(DAY,-10,ApplyTime)) as varchar)+'月' as 日期,count(*) as 通过数
from LoanApply where ApplyTime>'2017-03-10 00:00:00'and ApplyTime<'2019-01-10 00:00:00' and BusinessType=0 and MoneyCheckStatus=1
group by year(DATEADD(DAY,-10,ApplyTime)),month(DATEADD(DAY,-10,ApplyTime)) --统计从2017年3月份开始每个月金融服务支付前分期手续费
SELECT cast(datepart(year,DATEADD(DAY,-10,ApplyTime)) as varchar)+'年'+cast(datepart(month,DATEADD(DAY,-10,ApplyTime)) as varchar)+'月' as 日期,SUM(Amount)*0.005 as 手续费
from LoanApply where ApplyTime>'2017-03-10 00:00:00'and ApplyTime<'2019-01-10 00:00:00' and BusinessType=0 and MoneyCheckStatus=1
group by year(DATEADD(DAY,-10,ApplyTime)),month(DATEADD(DAY,-10,ApplyTime)) --统计从2018年5月份开始每个月金融服务支付后分期手续费
SELECT cast(datepart(year,ApplyTime) as varchar)+'年'+cast(datepart(month,ApplyTime) as varchar)+'月' as 日期,SUM(Amount)*0.005 as 手续费
from LoanApply where ApplyTime>'2018-05-01 00:00:00'and ApplyTime<'2019-01-01 00:00:00' and BusinessType=1 and MoneyCheckStatus=1
group by year(ApplyTime),month(ApplyTime)