Jeffrey,
If you are using SQL Server, then Stephen's solution will work. But, I don't believe that the Fox driver supports CASE in SQL statements. You can use a union, but remember that fields must be the same size, thus add SPACE(33) to the first errmsg so that it will be the same size as the second. There can only be one order by clause, and it must numerically refer to a column.
SELECT TEMPALIAS.*,
MF_158.DATE_IN AS IMPORTED,
'Record already imported.'+SPACE(33) AS Errmsg
FROM TEMPALIAS, MF_158
WHERE ALLT(TEMPALIAS.UNIQKEYSAS) = ALLT(MF_158.UNIQKEYSAS)
UNION
SELECT TEMPALIAS.*,
MF_158.DATE_IN AS IMPORTED,
'Records previously found as errors but have passed since.' AS Errmsg
FROM TEMPALIAS, PROB_158, MF_158
WHERE ALLT(TEMPALIAS.UNIQKEYSAS) = ALLT(PROB_158.UNIQKEYSAS)
INTO CURSOR INPR158
ORDER BY 1 ???
..., or something like that.
Hope this helps,
Phil
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement