回复 3楼 csyx
csyx老师你好!
非常感谢您昨天帮助写的代码。
第一段代码如下:
Close Databases
Use b1 In 0
Use b2 In 0 Exclusive
Zap in b2
Insert into b2 (xh,qihao,h1,h2,h3,xh2) select
xh,qihao,h1,h2,h3,xh-1 from b1 where h1 = 0
For ii = 1 to AFields(aFlds, 'b1')
cc = aFlds[ii,1]
If !(','+Lower(cc)+',' $
',xh,qihao,h1,h2,h3,xh2,')
Update b2 set b2.&cc = b1.&cc from b2 inner
join b1 on b2.xh2 == b1.xh
EndIf
EndFor
第一段代码运行后
“Insert into b2 (xh,qihao,h1,h2,h3,xh2) select
xh,qihao,h1,h2,h3,xh-1 from b1 where h1 = 0”
这句显示“语法错误”
“Update b2 set b2.&cc = b1.&cc from b2 inner join b1
on b2.xh2 == b1.xh”
这句显示“命令中有不能识别的短语或关键字”
----------------------------------------
第二段代码如下:
Close Databases
Use b1 In 0
Use b2 In 0 Exclusive
Select b1.*, b1.xh as xh2 from b1 inner join (select
xh from b1 where h1 == 0) b3 on b1.xh == b3.xh-1 into
cursor temp
Select b2
Zap
Append From Dbf('temp')
Use in temp
Update b2 set b2.xh = b1.xh, b2.qihao = b1.qihao,
b2.h1 = b1.h1, b2.h2 = b1.h2, b2.h3 = b1.h3 from b2
inner join b1 on b2.xh2 == b1.xh-1
第二段代码运行后,
“Select b1.*, b1.xh as xh2 from b1 inner join (select
xh from b1 where h1 == 0) b3 on b1.xh == b3.xh-1 into
cursor temp”
这句显示“语法错误”
“Append From Dbf('temp')”
这句显示“找不到别名”
“Use in temp”
这句显示“找不到别名”
“Update b2 set b2.xh = b1.xh, b2.qihao = b1.qihao,
b2.h1 = b1.h1, b2.h2 = b1.h2, b2.h3 = b1.h3 from b2
inner join b1 on b2.xh2 == b1.xh-1”
这句显示“命令中有不能识别的短语或关键字”
希望老师帮助解决上述二段代码的问题。谢谢!