18641, 71101, 00 PTS_001_003 df072-1 1 0
18642, 71101, 00 PTS_001_003 df072-1 1 0
18643, 71101, 00 PTS_001_003 df072-1 1 0
18644, 71101, 00 PTS_001_003 df072-1 1 0
18645, 71101, 00 PTS_001_003 df072-1 1 0
18646, 71101, 00 PTS_001_003 df072-1 1 0
18647 71101 00 PTS_001_003 df072-1 2 0
18648 71101 00 PTS_001_003 df072-1 2 0
As data table, and now want to take the record of OuterQrCodeID PackageLevel=1 in the table updated with PackageLevel ID=2, every three records with a new ID, and a quick print ID (PackageLevel=1)
The updated table:
ID OrderNo ProductCode PackageRule PackageLevel OuterQrCodeID
18641, 71101, 00 PTS_001_003 df072-1 1 18647
18642, 71101, 00 PTS_001_003 df072-1 of 1 18647
18643, 71101, 00 PTS_001_003 df072-1 of 1 18647
18644, 71101, 00 PTS_001_003 df072-1 1 18648
18645, 71101, 00 PTS_001_003 df072-1 of 1 18648
18646, 71101, 00 PTS_001_003 df072-1 of 1 18648
18647, 71101, 00 PTS_001_003 df072-1 2 0
18648, 71101, 00 PTS_001_003 df072-1 2 0
Don't know how to write should be nested, a great god, please help!
SQL3=SQL3 + "SELECT * FROM TB_pts_product"
SQL3=SQL3 + "WHERE (ProductCode=N '00 df072-1)"
SQL3=SQL3 + "AND" (OrderNo=N '071101') AND (PackageLevel=1) "
SQL3=SQL3 + "ORDER BY ID"
SQL4=SQL4 + "SELECT * FROM TB_pts_product"
SQL4=SQL4 + "WHERE (ProductCode=N '00 df072-1)"
SQL4=SQL4 + "AND" (OrderNo=N '071101') AND (PackageLevel=2) "
SQL4=SQL4 + "ORDER BY ID"
While Not tRecSql4. EOF
For I=1 To 3
While Not tRecSql3. EOF
LBL=tRecSql3
The Debug. Print LBL
TRecSql3. MoveNext
Wend
Next I
TRecSql4. MoveNext
Wend
CodePudding user response:
You write a nested right, in the for I=1 to 3 have to do is to update the data in this cycle,CodePudding user response: