try如果Retype是字符型,數據為 是 否
rs = "select PrintTime as 打印时间,Type as 类型,Copies as 数量 ,case when Retype=N'是' then ReUnitPrice*Copies else UnitPrice*Copies end as 金额 ,Retype as 重打印 from PrintRecord where PrintTime >= format('" & DTPicker1.Value & "' ,'yyyy-mm-dd hh:mm:ss') and PrintTime <= format('" & DTPicker2.Value & "','yyyy-mm-dd hh:mm:ss') ORDER BY PrintTime"如果Retype是Bit型
rs = "select PrintTime as 打印时间,Type as 类型,Copies as 数量 ,case when Retype=1 then ReUnitPrice*Copies else UnitPrice*Copies end as 金额 ,Retype as 重打印 from PrintRecord where PrintTime >= format('" & DTPicker1.Value & "' ,'yyyy-mm-dd hh:mm:ss') and PrintTime <= format('" & DTPicker2.Value & "','yyyy-mm-dd hh:mm:ss') ORDER BY PrintTime"
rs = "select PrintTime as 打印时间,Type as 类型,Copies as 数量 ,case when Retype=N'是' then ReUnitPrice*Copies else UnitPrice*Copies end as 金额 ,Retype as 重打印 from PrintRecord where PrintTime >= format('" & DTPicker1.Value & "' ,'yyyy-mm-dd hh:mm:ss') and PrintTime <= format('" & DTPicker2.Value & "','yyyy-mm-dd hh:mm:ss') ORDER BY PrintTime"如果Retype是Bit型
rs = "select PrintTime as 打印时间,Type as 类型,Copies as 数量 ,case when Retype=1 then ReUnitPrice*Copies else UnitPrice*Copies end as 金额 ,Retype as 重打印 from PrintRecord where PrintTime >= format('" & DTPicker1.Value & "' ,'yyyy-mm-dd hh:mm:ss') and PrintTime <= format('" & DTPicker2.Value & "','yyyy-mm-dd hh:mm:ss') ORDER BY PrintTime"
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货