Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement....
Message
De
19/06/1999 12:07:43
 
 
À
18/06/1999 16:06:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00231575
Message ID:
00231765
Vues:
21
>Can anyone tell me what's wrong with this sql statement? I keep getting the error message Function name missing )
>
>SELECT DISTINCT TMPLAB.ID, TMPREG.DOB, TMPINF.LIVRSKB ;
>FROM TMPREG, TMPINF, TMPLAB ;
>WHERE TMPLAB.ID = TMPREG.ID ;
>AND (TMPINF.LIVRSKB = .F. AND TMPINF.HEPBVACC = .F. AND TMPLAB.AHBS = 'P' AND TMPLAB.AHBC = 'P') ;
>AND (TMPLAB.LABIMPDATE >= M.DATE1 AND TMPLAB.LABIMPDATE <= M.DATE2) ;
>UNION ;
>SELECT DISTINCT TMPLAB.ID, TMPREG.DOB, TMPINF.LIVRSKB ;
>FROM TMPREG, TMPINF, TMPLAB ;
>WHERE TMPLAB.ID = TMPREG.ID ;
>AND (TMPINF.LIVRSKC = .F. AND AND TMPLAB.AHCV = 'P' AND TMPLAB.AHCVQ > 3) ;
>AND (TMPLAB.LABIMPDATE >= M.DATE1 AND TMPLAB.LABIMPDATE <= M.DATE2) ;
>INTO TABLE C:\HESDRA\HEPC


Stephen caught your syntax problem, but while looking for it, I noticed somthing: you are pulling the same fields from the same table in both SELECTS... why do you need a UNION clause? Your 2 sets of WHERE clauses could be joined with an OR.
Erik Moore
Clientelligence
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform