以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- SQL语句报错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=77892) |
-- 作者:L88919138 -- 发布时间:2015/11/27 11:21:00 -- SQL语句报错 一直提示这句语法错误,问下日期型应该怎么写代友码: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 |
-- 作者:大红袍 -- 发布时间:2015/11/27 11:39:00 -- msgbox(Cmd.CommandText) 看看。
直接在sql测试窗口,执行sql语句,报什么错 http://www.foxtable.com/help/topics/1484.htm
|