Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by problem
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00771194
Message ID:
00771302
Views:
33
This message has been marked as the solution to the initial question of the thread.
What exactly are you trying to do with this? Do you want the earliest date for each cauktcid or the latest date or just any date at all? The way your query is constructed will return the latter in pre VFP8 while it will not run in VFP8 without setting ENGINEBEHAVIOR. For first or last date use MIN() or MAX() on regdate and it should work in VFP8 and return the correct date. The following works in VFP6. Unfortunately, I don't have VFP8 yet to test it.
*!* if you need the earliest regdate 
Select cauktcid, DTOC(MIN(regdate)) as datum from auktlogg group by 1 into cursor cTempAuktion 
*!*or 
Select cauktcid, MIN(DTOC(regdate)) as datum from auktlogg group by 1 into cursor cTempAuktion 

*!* if you need the latest regdate 
Select cauktcid, DTOC(MAX(regdate)) as datum from auktlogg group by 1 into cursor cTempAuktion 
*!* or 
Select cauktcid, MAX(DTOC(regdate)) as datum from auktlogg group by 1 into cursor cTempAuktion 
The second example of each would not necessarily provide correct results as it compares the value as a character string and not as a date. example: max("10/20/2000","01/01/2003) would return "10/20/2000", however this would suffice if you need just any date. This would be more like the original result in pre VFP8.
HTH

>Hi All,
>
>How to get this working in VFP8 without setting ENGINEBEHAVIOR TO 70 ?
>
>
Select cauktcid, DTOC(regdate) as datum from auktlogg group by 1 into cursor cTempAuktion
>
>I want to have one record for each cauktid in table auktlogg with the date.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform