Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL problem when using MAX(Date) and GROUP BY
Message
From
11/10/2002 11:02:17
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL problem when using MAX(Date) and GROUP BY
Miscellaneous
Thread ID:
00710331
Message ID:
00710331
Views:
60
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
Map
View

Click here to load this message in the networking platform