General information
Category:
Coding, syntax & commands
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only