Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group by problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00771194
Message ID:
00771348
Vues:
22
Thank's Elmer,

This was exactly what i needed. Nice and well explained to.
Select cauktcid, DTOC(MIN(regdate)) as datum from auktlogg group by 1 into cursor cTempAuktion
Works fine in VFP8




>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.
/Torgny
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform