Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL problem when using MAX(Date) and GROUP BY
Message
De
11/10/2002 11:02:17
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
SQL problem when using MAX(Date) and GROUP BY
Divers
Thread ID:
00710331
Message ID:
00710331
Vues:
61
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
Fil
Voir

Click here to load this message in the networking platform