Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Server Select Statement
Message
From
21/07/2005 14:36:47
 
 
To
21/07/2005 14:26:19
Stephen Hunt
Admit Computer Services Inc.
Farmingdale, New York, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01034265
Message ID:
01034838
Views:
31
>Thanks that worked !! one additional request is there a way to include the judgecode as one of the columns in the result set ?

You can add to the results all the homogeneous fields of motorvehicle, locallaw...,
add they to the UNION's "select":
SELECT @judgecode = 'LLL'
SELECT pay.*,jj.judge  from Payments pay
  JOIN
  (SELECT 'MV' module,keyident,mv_judge judge FROM motorvehicle 
    UNION ALL
   SELECT 'LL' module,keyident,ll_judge       FROM locallaw 
    UNION ALL
   ....
    UNION ALL
   SELECT 'SC' module,keyident,sc_judge       FROM smallclaims ) jj
   ON     jj.keyident = pay.pkeyident 
      and jj.module   = pay.py_module 
      and jj.judge    = @judgecode
  WHERE pay.py_paydate BETW.............
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform