Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00388877
Message ID:
00388926
Vues:
7
This is in effect an INNER JOIN and won't bring any new records from the Temp2.

As I understand the problem, you have a set of records in Temp1. Temp2 is something like a trasnactional log that holds new values and updates to previous values. Try making the two SQL statements and UNIONing them.
select temp2.* from temp2 ;
  where between(temp2.dIssued,{05/01/2000},{05/31/2000}) ;
  and temp2.cKeyField in (select cKeyField from temp1) ;
  UNION ;
    select temp1.* from temp1 ;
      where between(temp1.dIssued,{05/01/2000},{05/31/2000}) ;
      and temp1.cKeyField not in (select cKeyField from temp2) ;
  into cursor temp
>>
>>*** code ***
>>use old in 0 alias temp1
>>use new in 0 alias temp2
>>
>>select temp2.* from temp2 ;
>>full outer join temp1 on temp2.cKeyField = temp1.cKeyField ;
>>where temp2.dIssued >= ctod('05/01/00') and temp2.dIssued <= ctod('05/31/00') ;
>>into cursor temp
>>
>>*** end code ***
>
>Try
>
>select temp2.* from temp2 ;
>where temp2.dIssued >= ctod('05/01/00') and temp2.dIssued <= ctod('05/31/00')and temp2.cKeyField = temp1.cKeyField ;
>into cursor temp
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform