Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get different sets of records from the same table
Message
 
 
To
11/08/2008 21:00:00
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01338221
Message ID:
01338235
Views:
16
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform