Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get different sets of records from the same table
Message
 
 
À
11/08/2008 21:00:00
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01338221
Message ID:
01338235
Vues:
13
This message has been marked as the solution to the initial question of the thread.
WIll this work for you?
...
		FROM cursorTemp ct ;
			JOIN SystemLookups slpr ON CursorTemp.EligRule = slpr.Value ;
				AND UPPER(slpr.FieldName) = 'ELIGRULE' ;
			JOIN EligibilityRules er ON CursorTemp.InsCarr = er.InsCarr ;
			JOIN SystemLookups slrt ON er.RuleType = slrt.Value ;
				AND UPPER(slrt.FieldName) = 'RULETYPE' ;
		INTO CURSOR EligibilityValidation READWRITE
>I need to get 2 different sets of records from the same lookup table (SystemLookups), but I can't quite figure out how to do it. It's almost like I need two different WHERE clauses. One for "ELIGRULE" and "RULETYPE" for another. Do I need to do this in 2 SQL Statements?
>
>
>	SELECT ;
>		ct.ptpn, ;
>		ct.ptSSN AS SSN, ;
>		ct.pt_DOB as DOB, ;
>		ct.Pt_Name AS FullName, ;
>		ct.PtFName AS FName, ct.PtMI AS MI, ct.PtLName AS LName, ;
>		er.InsCarr, ;
>		ct.CarrierName, ;
>		m.DateOfService AS DateOfService, ;
>		slpr.Descript AS PatientRule, ;
>		er.RuleDesc AS CarrierRuleDesc, ;
>		er.RuleType AS CarrierRuleCode, ;
>		slpr.Descript AS CarrierRuleType, ;
>		er.PeriodDays AS CarrierPeriodDays ;
>		FROM cursorTemp ct ;
>			JOIN SystemLookups slpr ON CursorTemp.EligRule = slpr.Value ;
>			JOIN EligibilityRules er ON CursorTemp.InsCarr = er.InsCarr ;
>			JOIN SystemLookups slrt ON er.RuleType = slrt.Value ;
>		WHERE UPPER(slpr.FieldName) = 'ELIGRULE' OR ;
>		WHERE UPPER(slrt.FieldName) = 'RULETYPE' ;
>		INTO CURSOR EligibilityValidation READWRITE
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform