以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]语法哪里错了  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=60942)

--  作者:hk1998
--  发布时间:2014/12/4 11:14:00
--  [求助]语法哪里错了
Dim cmd As New SQLCommand
Dim Count As Integer
Dim r As DataRow
Dim v As Double
r = DataTables("中转费").DataRows(0)
v = r("末端重量")
cmd.C
cmd.CommandText = " update  {rh_ytyd} set 中转费 = (Ceiling( v/0.5)) * rh_zzjg.价格 from {rh_ytyd} join {rh_zzjg} on rh_ytyd.运输方式=rh_zzjg.运输方式 And rh_ytyd.省份=rh_zzjg.价格分区 And rh_ytyd.末端重量 between rh_zzjg.起始重量 And rh_zzjg.结束重量 where DateDiff(dd,发件日期,getdate())<=60"
cmd.ExecuteNonQuery()
[此贴子已经被作者于2014-12-4 11:15:22编辑过]

--  作者:Bin
--  发布时间:2014/12/4 11:16:00
--  
提示什么错误? 
--  作者:Bin
--  发布时间:2014/12/4 11:23:00
--  
你这个,Update语法不能这么写的. 你具体要实现什么效果.
--  作者:hk1998
--  发布时间:2014/12/4 11:30:00
--  
http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=60797&replyID=&skin=1

实现取公式自动计算

--  作者:有点甜
--  发布时间:2014/12/4 11:31:00
--  
cmd.CommandText = " update  {rh_ytyd} set 中转费 = " & (Ceiling( v/0.5)) & " * rh_zzjg.价格 from {rh_ytyd} join {rh_zzjg} on rh_ytyd.运输方式=rh_zzjg.运输方式 And rh_ytyd.省份=rh_zzjg.价格分区 And rh_ytyd.末端重量 between rh_zzjg.起始重量 And rh_zzjg.结束重量 where DateDiff(dd,发件日期,getdate())<=60"
--  作者:hk1998
--  发布时间:2014/12/4 11:35:00
--  
你好,提示为声明名称ceiling
--  作者:有点甜
--  发布时间:2014/12/4 11:47:00
--  
cmd.CommandText = " update  {rh_ytyd} set 中转费 = " & (Math.Ceiling( v/0.5)) & " * rh_zzjg.价格 from {rh_ytyd} join {rh_zzjg} on rh_ytyd.运输方式=rh_zzjg.运输方式 And rh_ytyd.省份=rh_zzjg.价格分区 And rh_ytyd.末端重量 between rh_zzjg.起始重量 And rh_zzjg.结束重量 where DateDiff(dd,发件日期,getdate())<=60"
[此贴子已经被作者于2014-12-4 11:46:43编辑过]

--  作者:hk1998
--  发布时间:2014/12/4 11:55:00
--  
谢谢了