一直提示这句语法错误,问下日期型应该怎么写代友码:Cmd.CommandText = "Select sum(isnull(出仓数量 * 含税单价,0)) Fro m {销售收款统计表} Where 合同录入日期 >= '" & Date1 & "' And 合同录入日期 =< '" & Date2 & "'"
Dim jV As Object
Dim Date1 As Object = Forms("鲜迪狐表系统菜单").Controls("DateTimePicker1").Value
Dim Date2 As Object = Forms("鲜迪狐表系统菜单").Controls("DateTimePicker2").Value
Dim cmd As new SQLCommand
cmd.c
Cmd.CommandText = "Select sum(isnull(出仓数量 * 含税单价,0)) Fro m {销售收款统计表} Where 合同录入日期 >= '" & Date1 & "' And 合同录入日期 =< '" & Date2 & "'"
JV = cmd.ExecuteScalar