Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement using 5 tables
Message
From
14/04/2004 11:38:10
 
 
To
13/04/2004 22:59:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00894654
Message ID:
00894803
Views:
10
Sorry - hit the send button without doing anything.
SELECT CUSIP, ACCOUNT, FUND, FUND_ACCT, PHONENUM, FUNDNUM, DTOC(PREVRECN) AS Prev_Recn, NVL(past_due.reas_desc,'') AS Ovr30_reas,;
    NVL(oobreason.OOB_desc,'') AS oob_reason, NVL(oobaction.OOB_desc,'') AS act_taken, NVL(sourcedoc.doc_recv,'') AS source_doc, DTOC(STMT_DATE) AS STMT_DATE, FUND_POS, CMS_POS, RR_AMOUNT,;
    OOB_AMOUNT, DTOC(OOB_DATE) AS OOB_DATE, DTOC(TAKEACT_DT) AS TAKEACT_DT, CONTACT, CONT_NUM, OOB_NOTES, FIRST_USER,;
    DTOC(FIRST_DATE) AS FIRST_DATE, SEC_USER, DTOC(SEC_DATE) AS SEC_DATE, &age_date-PREVRECN AS age;
    FROM holdrecn h, 
left outer join oobreason on h.oob_num = oobreason.oob_num
left outer join oobaction on h.ACTION_NUM = oobaction.ACTION_NUM, 
left outer join sourcedoc on h.SOURCE_NUM = sourcedoc.SOURCE_NUM,
left outer join past_due on h.{fieldname} = past_due.{fieldname]
WHERE &itemtype AND &desctype;
INTO TABLE m.locdir+'\rept_data';
The NVL should take care of any null values returned from the joins.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Previous
Reply
Map
View

Click here to load this message in the networking platform