If Text1.Text <> "" Then
qbsj = "and (ghzq- DateDiff("d",ghsj, dqsj))>='" & Text1.Text & "'"
Else
qbsj = ""
End If
我要把qbsj加在sql查询语句的后面,其中dqsj是系统当前时间,ghsj是数据库表字段名,也是一个时间,text1.text是一个数字
总体意思是把数据库中的时间与当前时间相差大于text1.text天的记录查询出来
这个语句怎么写
qbsj = "and (ghzq- DateDiff("d",ghsj, dqsj))>='" & Text1.Text & "'"
Else
qbsj = ""
End If
我要把qbsj加在sql查询语句的后面,其中dqsj是系统当前时间,ghsj是数据库表字段名,也是一个时间,text1.text是一个数字
总体意思是把数据库中的时间与当前时间相差大于text1.text天的记录查询出来
这个语句怎么写
"select * from tb_sb_gl where id>0 and (ghzq-DateDiff('" & d & "',ghsj, getdate())>='" & Text1.Text & "'"
这是我的语句,提示 为datediff指定了无效参数1
试试
"select * from tb_sb_gl where id>0 and (ghzq-DateDiff('" & d & "',ghsj, getdate())>='" & Text1.Text & "'"
如果在这上面改,怎么改