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

Click here to load this message in the networking platform