สคริบอัพเดท lastvisit_vn จ้า
DateTime : 2011-07-19 01:44:10
Post By : decepticons
IP Address : 203.113.118.74
นำโค้ดด้านล่างไปบันทึกชื่อเป็น SYS_VN_SCRIPT ตรงแทบสคริบในสายฟ้า
และถ้าจะให้สคริบทำงานออโต้ ก็ต้องไปเลือก system seting ตรง ran vn script ด้วยนะครับ
var
fvn,fcomputername,fdepartment,fhn, scrcl,lastvisit_vn : string;
crcl, bw, LastCr, age_y, sex, a, factor : double;
cc:integer;
begin
fdepartment := GetGlobalValue('CURRENT_DEPCODE');
fvn:= GetGlobalValue('VN');
fhn:=getsqldata(' select hn from vn_stat where vn="'+fvn+'" ');
lastvisit_vn:=getsqldata(' select max(vn) from vn_stat where hn="'+fhn+'" and vn<>"'+fvn+'" ');
zquery.close;
zquery.sql.text:=' update vn_stat set lastvisit_vn ="'+lastvisit_vn+'" where vn="'+fvn+'" ' ;
zquery.execsql;
zquery.close;
end;
Message !!
หากต้องการตอบกระทู้ Webboard กรุณาเข้าใช้ระบบก่อนนะค่ะ..
กระทู้ตอบกลับ
สคริบนี้จะไม่มีฟอร์มโชว์ให้เห็นหน้าตานะครับ มันจำทำงานอยู่เบื้องหลังโปรแกรม ลองทดสอบจากคำสั่งนี้
select vn,hn ,lastvisit_vn from vn_stat where vstdate="2011-07-19"
Post โดย : decepticons Date: 2011-07-19 01:49:26 ip: 203.113.118.74
run แล้วได้แบบนี้ครับ
ok แล้ว ได้อันนี้ต่อ
ไม่รู้ว่าผิดพลาดตอนไหนครับ
Post โดย : pitaya Date: 2011-09-13 16:15:08 ip: 118.172.105.254
ขอบคุณมากครับพี่
Post โดย : optimus Date: 2011-09-14 20:09:05 ip: 203.113.116.116