Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Could this be a correlated subquery
Message
From
03/08/2023 12:41:32
 
 
To
02/08/2023 16:02:36
John Ryan
Captain-Cooker Appreciation Society
Taumata Whakatangi ..., New Zealand
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01686890
Message ID:
01686892
Views:
55
Thanks John...I will give it a whirl.

>>>- both files have to be from the same Plaintiff (field Plaintf_ID)
>>>- files cannot be the same File_Type (one must be a "P" and the other a "D")
>>>- File_ID is the primary key
>>>- PartFile is the table that holds one record for each "file" (law firms sometimes call this a "matter")
>
>I'm expecting you could do this with a self-join along the lines of
>
>
>SELECT ;
>   P.Plaintf_ID, P.File_ID, P.Lastname, P.Firstname, P.Partner, P.Our_FileNo, P.Plain_Defn ;
>  from partfile P inner join partfile D on P.Plaintf_ID=D.Plaintf_ID and P.file_type='P' and D.file_type='D' ;
>  where P.settled=.T. and empty(D.date_fund) and empty(D.date_closd) ;
>   INTO CURSOR SettledNF READWRITE
>
>
>You'd need to refine the WHERE clause to match exact settled/funded requirements for the P and D files, but that ought to be easy enough.
>
>Also note that some people would consider the join to be overloaded, with file_type clauses best moved to the WHERE, but I don't think this affects Rushmore and I find it more legible. You might want to experiment with join versus where if the query is slow.
Previous
Reply
Map
View

Click here to load this message in the networking platform