1. 程式人生 > >收集的一些常用的VF命令

收集的一些常用的VF命令

1.工作中用到的一些:

appe from ../sjshb

zap

repl wttdbz with '1' all

open sjswt share

use

brow

repl wtzqdm with 000001 for wtywbz='0C'

brow for left(gfywlb,1) != 'A'

modi修改DBF表結構

2.取得日期:
repl ls with substr(certid,11,4) for len(alltrim(certid))=18
brow
repl ls with substr(certid,9,4) for len(alltrim(certid))=15
modi stru
repl all ls1 with left(ls,2)+'月'+right(ls,2)+'日'


case 語句:
select b.servnumber,
case when a.privid=75900000062422 then ''
when a.privid=75900000062423 then ''
when a.privid=75900000062424 then ''
when a.privid=75900000062425 then ''
end
from zjzw.cm_Subs_Privilege a join zjzw.cm_subs_subscriber b on a.subsid=b.subsid
where a.privid in (75900000062422,75900000062423,75900000062424,75900000062425)


3.壓縮語句:
delete for substr(dhhm,1,1)!='1'

4.向表中加入記錄程式:
set safe off
sele a
use ls
zap
pack
index on dhhm to s
sele b
use bb_hf_610
go top
do while .not. eof()
   aa=dhhm
   sele a
   seek aa
   if found()
      repl hf_610 with b->to_hf
   else
      appe blank
      repl dhhm with aa
      repl hf_610 with b->to_hf
   endif
   sele b
   skip

enddo

5.顯示目錄:
dir.*或dir
case等效語句:
repla all stopkey with ''for stopkey='00020000'
repla all stopkey with ''for stopkey='00002000'
repla all stopkey with ''for stopkey='20000000'
repla all stopkey with ''for stopkey='02000000'
repla all stopkey with ''for stopkey='00200000'

6.求和過程中消除零情況處理;
iif(isnull(a.amt),0,a.amt);

7.多表連線求和(同一號碼):
select a.dhhm,iif(isnull(a.to_hf ),0,a.to_hf )+b.to_hf+c.to_hf+d.to_hf+e.to_hf+f.to_hf  as avgconsume ;
FRom bb_hf_703_bk a left join bb_hf_702_bk b on a.dhhm=b.dhhm left join bb_hf_701_bk c on a.dhhm=c.dhhm ;
left join bb_hf_612_bk d on a.dhhm=d.dhhm left join bb_hf_611 e on a.dhhm=e.dhhm left join bb_hf_610 f on a.dhhm=f.dhhm
8. dbf檔案轉換成txt檔案:
appe from filename.txt sdf