|
SELECT Count(DLookUp("[姓名]","数据库")) AS 总户数, Sum([数据库].[核定总额]) AS 总金额, Count([数据库].[信用等级]) AS 已核定户数, Sum(IIf([信用等级] Is Null,0,[核定总额])) AS 已核定总额, Format([已核定户数]/[总户数],"ercent") AS 已核定占比, Sum(IIf([信用等级]=3,1,0)) AS A类户数, Sum(IIf([信用等级]=3,[核定总额],0)) AS A类已核定总额, Format([A类户数]/[已核定户数],"ercent") AS A类占评定户数, Sum(IIf([信用等级]=2,1,0)) AS AA类户数, Sum(IIf([信用等级]=2,[核定总额],0)) AS AA类已核定总额, Format([AA类户数]/[已核定户数],"ercent") AS AA类占评定户数, Sum(IIf([信用等级]=1,1,0)) AS AAA类户数, Sum(IIf([信用等级]=1,[核定总额],0)) AS AAA类已核定总额, Format([AAA类户数]/[已核定户数],"Percent") AS AAA类占评定户数
FROM 数据库;
|
|