回 帖 发 新 帖 刷新版面

主题:急!!请教老师

set talk off
clear      
close data
USE EED
DELETE ALL 
PACK
USE Eb
DELETE ALL 
PACK
clos all
clos all
use dh2 in 0
use DH6 in 0
select DH6
go top
do while not eof()
select * into table C1 from DH6 where 客户号=DH2.客户号
use eed
copy to ma fields 商品,数量
use ma
    index on 商品 to inma
    total on 商品 to maa fields 数量
 
use 
sele 1
use maa
index on 商品 to inmaa
sele 2
USE Ez                     
index on 商品 to inEz
sele 3
use qmkc
index on 商品 to inqmkc
set relation to 商品 into a
set relation to 商品 into b additive
copy to ET fields 商品,库存,a->数量,b->余库存
use ET
replace all 余库存 with 库存-数量
COPY TO qmkc
select 4
use qmkc
index on 商品 to inqmkc
select 5
USE EA                      &&&&&&切记自做表
index on 商品 to inEA
select 6
use dda
index on 商品 to indda
set relation to 商品 into d
set relation to 商品 into e additive
copy to EE fields 发货日期,客户号,商品,数量,d->余库存,e->欠缺计划
use EE
replace all 欠缺计划 with 数量-余库存
copy to EM           

USE 
USE eed
APPEND FROM dda
USE eb
APPEND FROM em

 select DH2  &&&&&&&找不到别名 DH2
  skip
enddo
retu

各位老师的办法,都用过了,
QMKC 表正在使用中?

谢谢!!!


我的代码是否复杂,有简单的吗??

回复列表 (共13个回复)

11 楼

[quote]标题标题,点明问题。
不说问题,光说急。
你急谁不急,
那你就只有干着急。[/quote]

老师光见你说,你可以指点一下吗???

虚心请教的人

12 楼

试试:
set talk off
clear      
close data
USE EED
DELETE ALL 
PACK
USE Eb
DELETE ALL 
PACK
clos all
use dh2 in 10
use DH6 in 0
select DH6
go top
do while not eof()
select * into table C1 from DH6 where 客户号=DH2.客户号
use eed
copy to ma fields 商品,数量
use ma
    index on 商品 to inma
    total on 商品 to maa fields 数量
use 
sele 1
use maa
index on 商品 to inmaa
sele 2
USE Ez                     
index on 商品 to inEz
sele 3
use qmkc
index on 商品 to inqmkc
set relation to 商品 into a
set relation to 商品 into b additive
copy to ET fields 商品,库存,a->数量,b->余库存
use ET
replace all 余库存 with 库存-数量
COPY TO qmkc
select 4
use qmkc
index on 商品 to inqmkc
select 5
USE EA                      &&&&&&切记自做表
index on 商品 to inEA
select 6
use dda
index on 商品 to indda
set relation to 商品 into d
set relation to 商品 into e additive
copy to EE fields 发货日期,客户号,商品,数量,d->余库存,e->欠缺计划
use EE
replace all 欠缺计划 with 数量-余库存
copy to EM           
USE eed
APPEND FROM dda
USE eb
APPEND FROM em

 select DH2  &&&&&&&找不到别名 DH2
  skip
enddo

13 楼

select 0
use dh2

select 0
use DH6

我来回复

您尚未登录,请登录后再回复。点此登录或注册