Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating cursor with 3 fields from source table
Message
 
 
To
08/04/2007 23:45:53
Randy Wessels
Screentek Business Solutions, Llc.
Phoenix, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01213336
Message ID:
01213383
Views:
10
You're welcome.

>That worked great - thank you.
>
>>You have to use UNION to comboine 3 reps into one cursor
>>
>>
>>SELECT invpost.salesrep1 as salesrep,
>>		PADR(ALLTRIM(salesrep.fname) + ' ' + ALLTRIM(salesrep.lname),50) as repname
>>	FROM invpost
>>		JOIN salesrep on invpost.salesrep1 = salesrep.salesrep
>>	 WHERE NOT EMPTY(invpost.salesrep1)
>>UNION
>>SELECT invpost.salesrep2 as salesrep,
>>		PADR(ALLTRIM(salesrep.fname) + ' ' + ALLTRIM(salesrep.lname),50) as repname
>>	FROM invpost
>>		JOIN salesrep on invpost.salesrep2 = salesrep.salesrep
>>	 WHERE NOT EMPTY(invpost.salesrep2)
>>UNION
>>SELECT invpost.salesrep3 as salesrep,
>>		PADR(ALLTRIM(salesrep.fname) + ' ' + ALLTRIM(salesrep.lname),50) as repname
>>	FROM invpost
>>		JOIN salesrep on invpost.salesrep3 = salesrep.salesrep
>>	 WHERE NOT EMPTY(invpost.salesrep3)
>>ORDER BY 1
>>INTO CURSOR curRep
>>
>>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform