以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 请帮忙看看倒数第二句的语法错误在哪啊? (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=176082) |
-- 作者:huastar -- 发布时间:2022/3/29 21:52:00 -- 请帮忙看看倒数第二句的语法错误在哪啊? Dim dm1 As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1") Dim dm2 As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker2") Dim dtm1 As Date = dm1.Value Dim dtm2 As Date = dm2.Value Dim sql As String = "Se1ect top 50 b.vak13 As 收费时间, c.vaa03 As 门诊号, c.vaa05 As 病人姓名, a.项目名称,规格,单位,收入费别, " & _ "原单价,实收单价,数量,减免优惠,折扣优惠,应收金额 as 全额,实收金额 as 应收金额,开单科室,开单医生,执行科室 from {UF_VAJ_FULL} a join {V_VAK_FULL} b on a.vak01 = b.vak01 " & _ "left join vaa1 c on b.vaa01 = c.vaa01" & _ "And vak13 >= \'" & dtm1 & "\'And vak13 <= \'" & dtm2 & "\'" Tables("窗口1_Table1").Fill( sql ,"ybcs",True)
|
-- 作者:有点蓝 -- 发布时间:2022/3/29 21:58:00 -- 什么数据库?提示什么错误? 表名的别名加上as,比如 {UF_VAJ_FULL} as a
|
-- 作者:huastar -- 发布时间:2022/3/30 10:26:00 -- 错误提示为 ”se1ect语句执行错误,请检查语法及数据源设置“ 就是倒数第二句 "And vak13 >= \'" & dtm1 & "\'And vak13 <= \'" & dtm2 & "\'" 这里的标点符号不对,如果没有换行符,提上去就可以。加了换行符后,开头加了个分好就不行了
|
-- 作者:有点蓝 -- 发布时间:2022/3/30 10:57:00 -- 那就不要换行了,或者改为 Dim sql As String = "Se1ect top 50 b.vak13 As 收费时间, c.vaa03 As 门诊号, c.vaa05 As 病人姓名, a.项目名称,规格,单位,收入费别, " sql = sql & "原单价,实收单价,数量,减免优惠,折扣优惠,..........
|