Private Sub Command1_Click()
'统计应收宿费、预收宿费
If DTP1.Value <= DTP2.Value Then
G1.Text = Left(DTP1, 4) & Right(Left(DTP1, 7), 2) & Right(DTP1, 2) & Left(DTM1, 2) & Left(Right(DTM1, 5), 2)
G2.Text = Left(DTP2, 4) & Right(Left(DTP2, 7), 2) & Right(DTP2, 2) & Left(DTM2, 2) & Left(Right(DTM2, 5), 2)
Data1.RecordSource = "select * from djys where djys.BZ >" & Val(G1.Text) & "AND djys.bz< " & Val(G2.Text) & " order by 凭证号码"
Data1.Refresh
Data2.RecordSource = "select count(*) as ddd,sum(应收宿费)as 应收宿费1 ,sum(预收金额)as 预收汇总 from djys where djys.BZ >" & Val(G1.Text) & "AND djys.bz<" & Val(G2.Text)
Data2.Refresh
If Data2.Recordset.Fields(1) <> "" Then Labys.Caption = Format(Data2.Recordset.Fields(1), "0.00") Else Labys.Caption = "0"
If Data2.Recordset.Fields(2) <> "" Then Labyj.Caption = Format(Data2.Recordset.Fields(2), "0.00") Else Labyj.Caption = "0"
Else
main_ts7.Show
main_ts7.Label3.Caption = "日期不能颠倒!"
DTP2.Value = Date
End If
End Sub为什么总提示“标准表达式中数据类型不匹配”。djys是一张表,BZ是它其中的一个属性,BZ是文本型,我觉得错误好像是和BZ有关,请大家帮忙看看那句有错误,该怎么改?
'统计应收宿费、预收宿费
If DTP1.Value <= DTP2.Value Then
G1.Text = Left(DTP1, 4) & Right(Left(DTP1, 7), 2) & Right(DTP1, 2) & Left(DTM1, 2) & Left(Right(DTM1, 5), 2)
G2.Text = Left(DTP2, 4) & Right(Left(DTP2, 7), 2) & Right(DTP2, 2) & Left(DTM2, 2) & Left(Right(DTM2, 5), 2)
Data1.RecordSource = "select * from djys where djys.BZ >" & Val(G1.Text) & "AND djys.bz< " & Val(G2.Text) & " order by 凭证号码"
Data1.Refresh
Data2.RecordSource = "select count(*) as ddd,sum(应收宿费)as 应收宿费1 ,sum(预收金额)as 预收汇总 from djys where djys.BZ >" & Val(G1.Text) & "AND djys.bz<" & Val(G2.Text)
Data2.Refresh
If Data2.Recordset.Fields(1) <> "" Then Labys.Caption = Format(Data2.Recordset.Fields(1), "0.00") Else Labys.Caption = "0"
If Data2.Recordset.Fields(2) <> "" Then Labyj.Caption = Format(Data2.Recordset.Fields(2), "0.00") Else Labyj.Caption = "0"
Else
main_ts7.Show
main_ts7.Label3.Caption = "日期不能颠倒!"
DTP2.Value = Date
End If
End Sub为什么总提示“标准表达式中数据类型不匹配”。djys是一张表,BZ是它其中的一个属性,BZ是文本型,我觉得错误好像是和BZ有关,请大家帮忙看看那句有错误,该怎么改?
试试
你是不是找时间呢?g1.text,g2.text得出的结果是什么?
DTP2.Value = Date
G1.Text = Left(DTP1, 4) & Right(Left(DTP1, 7), 2) & Right(DTP1, 2) & Left(DTM1, 2) & Left(Right(DTM1, 5), 2)
G2.Text = Left(DTP2, 4) & Right(Left(DTP2, 7), 2) & Right(DTP2, 2) & Left(DTM2, 2) & Left(Right(DTM2, 5), 2)
下载地址:
ftp://14316:[email protected]/只要输入对方QQ号就行啦,强行和她聊天,程序介面不是很好看,没处理太好,请理解我噢,用啦就知道有多好了,,,
骗人是小狗。我的QQ号是:2247828769 我也可以发你的,哈哈。不过不要做乱事呀。