Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
SQL problem when using MAX(Date) and GROUP BY
Hi,
I'm working with VFP7 SP1. I'm trying to implement the following SQL syntax
SELECT ContactPic,MAX(Created_On),FlagFk FROM Contflag ;
WHERE INLIST(FlagFk, [ATV],[AUV]) AND (EMPTY(Ceased) OR ISNULL(Ceased)) AND NOT DELETED() ;
INTO CURSOR TaxClaimGlobalDecs GROUP BY ContactPic READWRITE
However while it returns the MAX of field Created_On it doesn't return the value for FlagFk from the same record...
ContactPic Created_On FlagFk
ABBOT93EDW 13/04/02 ATV
ABBOT93EDW 01/04/02 AUV
Using the SQL statement with the above data, the result is
ABBOT93EDW 13/04/02 AUV
What is the way around this?
I think I saw a thread begun by Nadya Nosonovsky along these lines but can't find it now.
Thanks,
Stewart
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