Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Cecil Champenois
  Where is Cecil Champenois?
 Little Elm
 Texas - United States
 Cecil Champenois
 Tags
Subject: RE: Two conditions in IF Statement
Thread ID: 345461 Message ID: 345463 # Views: 59 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Wednesday, May 23, 2012 3:15:26 PM         
   


> The second part of the IF condition doesn't seem to ever work. The "S" represents a SPOUSE.
>
> SELECT tmpCursorABQ
> SCAN
> 	* If there is a Spouse, get the Name and Date of Birth and put this data
> 	* into the above cursor.
> 	lcID=tmpCursorABQ.GrpID+tmpCursorABQ.GrpNum
> 	IF SEEK(lcID, "GRPEXTDP", "FULL_KEY") AND LEFT(GRPEXTDP.Relatecd,1)="S"
> 		REPLACE ;
> 			tmpCursorABQ.SpouseFN  WITH GRPEXTDP.FirstName, ;
> 			tmpCursorABQ.SpouseIn  WITH GRPEXTDP.Initial, ;
> 			tmpCursorABQ.SpouseLN  WITH GRPEXTDP.LastName, ;
> 			tmpCursorABQ.SpouseDOB WITH DTOS(GRPEXTDP.DOB)
> 	ENDIF
> ENDSCAN
> 

> Cecil Champenois, Jr.

What does it do?

PS: You can also write that as an update (replace with the key expression instead of full_key):

Update tmpCursorABQ ;
 set SpouseFN = GRPEXTDP.FirstName, ;
	SpouseIn  = GRPEXTDP.Initial, ;
	SpouseLN  = GRPEXTDP.LastName, ;
	SpouseDOB = DTOS(GRPEXTDP.DOB) ;
 from GRPEXTDP ;
 where tmpCursorABQ.GrpID+tmpCursorABQ.GrpNum = GRPEXTDP.Full_Key




Cetin Basoz

.Net has got better.Think about moving - check my blog:
My Blog
Blog (mirror) - sounds to be down


Support Wikipedia

ENTIRE THREAD

Two conditions in IF Statement Posted by Cecil Champenois @ 5/23/2012 3:01:21 PM
RE: Two conditions in IF Statement Posted by Cetin Basoz @ 5/23/2012 3:15:26 PM
RE: Two conditions in IF Statement Posted by Cecil Champenois @ 5/23/2012 3:19:33 PM
RE: Two conditions in IF Statement Posted by Cetin Basoz @ 5/23/2012 3:31:29 PM
RE: Two conditions in IF Statement Posted by Mike Yearwood @ 5/23/2012 4:43:26 PM