感谢楼上解释,意思大致我能明白,不过不懂怎么加入到代码中去,可否在帮忙看一下:
我的查询代码如下:
SELECT T1.会员编号 AS 会员编号, T1.会所 AS 会所, IIf(T1.销售日期<#2016/5/1#,1,IIf(T1.销售日期>=#2016/5/1# And T1.销售日期<=#2016/6/30#,1.06,1.03)) AS 税率, IIf(T1.开始日期 Is Null Or T1.开始日期=#1900/1/1#,T1.合同金额,IIf(T1.销售日期>T1.开始日期,(T1.结束日期-#2017/2/28#)/(T1.结束日期-T1.销售日期)*T1.合同金额,IIf(#2017/2/28#<T1.开始日期,T1.合同金额,(T1.结束日期-#2017/2/28#)/(T1.结束日期-T1.开始日期)*T1.合同金额))) AS 会籍余额, 会籍余额/税率 AS 会籍余额(去税)
FROM (select *from [Sheet1$] IN "D:\Users\peifeng.huang\Desktop\会籍直线法 - access测试用.xlsx" "EXCEL 8.0;"
) AS T1
如果代码可以运行
SELECT TOP 60000 T1.会员编号 AS 会员编号, T1.会所 AS 会所, IIf(T1.销售日期<#2016/5/1#,1,IIf(T1.销售日期>=#2016/5/1# And T1.销售日期<=#2016/6/30#,1.06,1.03)) AS 税率, IIf(T1.开始日期 Is Null Or T1.开始日期=#1900/1/1#,T1.合同金额,IIf(T1.销售日期>T1.开始日期,(T1.结束日期-#2017/2/28#)/(T1.结束日期-T1.销售日期)*T1.合同金额,IIf(#2017/2/28#<T1.开始日期,T1.合同金额,(T1.结束日期-#2017/2/28#)/(T1.结束日期-T1.开始日期)*T1.合同金额))) AS 会籍余额, 会籍余额/税率 AS 会籍余额(去税)
FROM (select *from [Sheet1$] IN "D:\Users\peifeng.huang\Desktop\会籍直线法 - access测试用.xlsx" "EXCEL 8.0;"
) AS T1
总记录:4篇 页次:1/1 9 1 :