Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TableUpdate
Message
From
01/11/2006 17:12:55
 
 
To
01/11/2006 08:16:49
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP
Miscellaneous
Thread ID:
01166090
Message ID:
01166402
Views:
13
>Here is the situation that I have:
>
>
>SET ORDER TO gd_key
>DO WHILE SEEK(SUBSTR(revall.vi_key,1,1)+revall.vi_vouchnm+SUBSTR(revall.vi_key,12,25))
>  REPLACE iagdtail.gd_chknum WITH ALLTRIM(STR(VAL(RIGHT(revall.new_chk,9)))) ;
>          iagdtail.gd_trandte WITH Thisform.r_cdate,;
>	 iagdtail.gd_key  WITH LEFT(iagdtail.gd_key,1) + ALLTRIM(revall.new_chk) + iagdtail.gd_fundcod + DTOC(Thisform.r_cdate) +RIGHT(iagdtail.gd_key,1) ;
>	 iagdtail.gd_trannum WITH ALLTRIM(revall.new_chk)
>
>	 TABLEUPDATE(.F., .F., "IAGDTAIL")	
>ENDDO()
>
>
>The problem is that when revall.new_chk is the same as iagdtail.gd_chknum of a different record. Let say the following is sample data
>
>gd_chknum new_chk
> 222 223
> 223 224
> 224 225
>
>The first record works fine. But when I am working on the second records there are twice as many records that fir the criteria because I change the records for the first record.
>
>How do I avoid eeing the records that were already changes when processing the second and third records?
>
>Thank you

uses UPDATE
update (alias()) SET iagdtail.gd_chknum = ALLTRIM(STR(VAL(RIGHT(revall.new_chk,9)))) ;
          iagdtail.gd_trandte = Thisform.r_cdate,; && NOT GOOD TO USE THISFORM.
	 iagdtail.gd_key  = LEFT(iagdtail.gd_key,1) + ALLTRIM(revall.new_chk) + iagdtail.gd_fundcod + DTOC(Thisform.r_cdate) +RIGHT(iagdtail.gd_key,1) ;
	 iagdtail.gd_trannum = ALLTRIM(revall.new_chk);
    WHERE <KEY('gd_key')>=LEFT(revall.vi_key,1)+revall.vi_vouchnm+SUBSTR(revall.vi_key,12,25)
Previous
Reply
Map
View

Click here to load this message in the networking platform