Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Should SQL statement be one or more
Message
De
04/05/2005 14:32:19
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Should SQL statement be one or more
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01010960
Message ID:
01010960
Vues:
83
I have a select statement as such:
SELECT CLIENTNM.DISTRICT, ADDRES.STATE, ALIASES.NAME_ALIAS, ;
  CLNTREF.REF_COD, CR_HIST.VDATE, CUSTOMER.CR_RATING, PRODUCTS.DEDNT ;
 FROM CLIENTNM, ADDRES, ALIASES, CLNTREF, CR_HIST, CUSTOMER, PRODUCTS, ;
    CONTACT ;
  WHERE CLIENTNM.IDCLIENT = ADDRES.IDCLIENT AND ;
    ADDRES.ADDRESS_TY = "MN" AND ;
    CLIENTNM.IDCLIENT = ALIASES.IDCLIENT AND ;
    ALIASES.ALIAS_TYPE = "MAIN" AND ;
    CLIENTNM.IDCLIENT = CUSTOMER.IDCLIENT AND ;
    CLIENTNM.IDCLIENT = PRODUCTS.IDCLIENT AND ;
    CLIENTNM.IDCLIENT = CR_HIST.IDCLIENT AND ;
    CLIENTNM.IDCLIENT = CONTACT.IDCLIENT AND ;
    CLIENTNM.IDCLIENT = CLNTREF.IDCLIENT AND ;
    CONTACT.CONTACT_ID = CLNTREF.CONTACT_ID ;
  ORDER BY 1 DESC ;
  INTO TABLE CLNTSHAWNA.DBF
but the result table brings up multiple instances of any client where there are 2 or more records in cr_hist and/or clntref. I want the latest date for the cr_hist.vdate for each client and just one record from the clntref for the client.

Would it be easier to do several select statements to get this infor, or can someone show me the way to do it for one select statement.

Thanks in Advance.
Beth
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform