toikhongvao
Thành viên mới

- Tham gia
- 4/1/10
- Bài viết
- 18
- Được thích
- 2
trong đoạn code này, chức năng là đếm số bút toán của nhân viên. Khi chạy báo lỗi ở dòng 3, chọn bỏ qua thì báo lỗi tiếp ở dòng 7, bỏ qua thì nó bảo chọn file database thì chạy ngon lành, tới dòng cuối từ dưới đếm lên 4 thì báo lỗi chổ cn.
Mình chỉ muốn hỏi ý nghĩa câu select 0 và if empty
THX
Mình chỉ muốn hỏi ý nghĩa câu select 0 và if empty
THX
[FONT="]para [/FONT][FONT="]namthang,cn[/FONT]
[FONT="]mdir='bcao\dbf\'[/FONT]
[FONT="]file_kq='kq'+cn+'.dbf'[/FONT]
[FONT="]clos data[/FONT]
[FONT="]set safe off[/FONT]
[FONT="]wait wind nowa [/FONT][FONT="]'Dang lay but toan cua teller..'[/FONT]
[FONT="]use [/FONT][FONT="]mdir+ 'ps&namthang.dbf' [/FONT][FONT="]alia [/FONT][FONT="]ps[/FONT]
[FONT="]sele [/FONT][FONT="]* [/FONT][FONT="]from [/FONT][FONT="]ps [/FONT][FONT="]into dbf [/FONT][FONT="]temp [/FONT][FONT="]where [/FONT][FONT="](nsd='BDU' or nsd='TDM' or nsd='BCA' or nsd='TAU' or nsd='SSO' or nsd='TPK' or nsd='PGI' or nsd='DTG')[/FONT]
[FONT="]wait wind nowa [/FONT][FONT="]'Dang lay so luong but toan..'[/FONT]
[FONT="]sele dist [/FONT][FONT="]nsd,ngay,sbt,' ' [/FONT][FONT="]as [/FONT][FONT="]cn,' ' [/FONT][FONT="]as [/FONT][FONT="]dp,' ' [/FONT][FONT="]as [/FONT][FONT="]fx,' ' [/FONT][FONT="]as [/FONT][FONT="]gl,' ' [/FONT][FONT="]as [/FONT][FONT="]ln1,' ' [/FONT][FONT="]as [/FONT][FONT="]ln2,' ' [/FONT][FONT="]as [/FONT][FONT="]ln3,' ' [/FONT][FONT="]as [/FONT][FONT="]ln4,' ' [/FONT][FONT="]as [/FONT][FONT="]ln5,' ' [/FONT][FONT="]as [/FONT][FONT="]khac ;[/FONT]
[FONT="]from [/FONT][FONT="]temp [/FONT][FONT="]into dbf [/FONT][FONT="]ketqua [/FONT][FONT="]orde by [/FONT][FONT="]1,2,3[/FONT]
[FONT="]clos data[/FONT]
[FONT="]*[/FONT]
[FONT="]wait wind nowa [/FONT][FONT="]'Dang index...'[/FONT]
[FONT="]sele [/FONT][FONT="]0[/FONT]
[FONT="]use [/FONT][FONT="]temp [/FONT][FONT="]alia [/FONT][FONT="]sl [/FONT][FONT="]excl[/FONT]
[FONT="]inde on [/FONT][FONT="]nsd+[/FONT][FONT="]dtos[/FONT][FONT="](ngay)+sbt [/FONT][FONT="]tag [/FONT][FONT="]tmp[/FONT]
[FONT="]sele [/FONT][FONT="]0[/FONT]
[FONT="]use [/FONT][FONT="]ketqua [/FONT][FONT="]alia [/FONT][FONT="]kq [/FONT][FONT="]excl[/FONT]
[FONT="]scan[/FONT]
[FONT="]=[/FONT][FONT="]seek[/FONT][FONT="](nsd+[/FONT][FONT="]dtos[/FONT][FONT="](ngay)+sbt,'sl')[/FONT]
[FONT="]wait wind nowa [/FONT][FONT="]nsd+[/FONT][FONT="]dtos[/FONT][FONT="](ngay)+sbt[/FONT]
[FONT="]do case[/FONT]
[FONT="] case [/FONT][FONT="]sl.buscd='DP'[/FONT]
[FONT="]repl [/FONT][FONT="]dp [/FONT][FONT="]with [/FONT][FONT="]'1'[/FONT]
[FONT="]case [/FONT][FONT="]sl.buscd='FX'[/FONT]
[FONT="]repl [/FONT][FONT="]fx [/FONT][FONT="]with [/FONT][FONT="]'1'[/FONT]
[FONT="]case [/FONT][FONT="]sl.buscd='GL'[/FONT]
[FONT="]sele [/FONT][FONT="]sl[/FONT]
[FONT="]loca while [/FONT][FONT="]nsd+[/FONT][FONT="]dtos[/FONT][FONT="](ngay)+sbt=kq.nsd+[/FONT][FONT="]dtos[/FONT][FONT="](kq.ngay)+kq.sbt [/FONT][FONT="]for [/FONT][FONT="]tk='7' or tk='8'[/FONT]
[FONT="]if foun[/FONT][FONT="]()[/FONT]
[FONT="]sele [/FONT][FONT="]kq[/FONT]
[FONT="]repl [/FONT][FONT="]gl [/FONT][FONT="]with [/FONT][FONT="]'1'[/FONT]
[FONT="]else[/FONT]
[FONT="] sele [/FONT][FONT="]kq[/FONT]
[FONT="]repl [/FONT][FONT="]khac [/FONT][FONT="]with [/FONT][FONT="]'1'[/FONT]
[FONT="]endi [/FONT]
[FONT="] case [/FONT][FONT="]sl.buscd='LN'[/FONT]
[FONT="]stor [/FONT][FONT="]' ' [/FONT][FONT="]to [/FONT][FONT="]ln1,ln2,ln3,ln4,ln5,khac[/FONT]
[FONT="]sele [/FONT][FONT="]sl[/FONT]
[FONT="]seek [/FONT][FONT="]kq.nsd+[/FONT][FONT="]dtos[/FONT][FONT="](kq.ngay)+kq.sbt[/FONT]
[FONT="]loca while [/FONT][FONT="]nsd+[/FONT][FONT="]dtos[/FONT][FONT="](ngay)+sbt=kq.nsd+[/FONT][FONT="]dtos[/FONT][FONT="](kq.ngay)+kq.sbt [/FONT][FONT="]for [/FONT][FONT="]trcd='W011'[/FONT]
[FONT="]if foun[/FONT][FONT="]()[/FONT]
[FONT="] ln1='1'[/FONT]
[FONT="]endi[/FONT]
[FONT="]*[/FONT]