Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL - for datetime field.
Message
De
12/05/1998 09:56:02
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00098538
Message ID:
00098736
Vues:
28
>I would change the suggestion from:
>>> SELECT datetime, ttoc(datetime),count(*) from tablename group by 2 into cursor busytime
>to
>>> SELECT datetime, hour(datetime),count(*) from tablename group by 2 into cursor busytime
>
>the first will give you a count for each distinct time, down to the second (or even fraction, not sure), so unless two events happened on exactly the same time, you would get a count of 1 for each time that anything happened. by taking the hour that events occurred, you get a count of how many events occurred during that hour. with a tad more effort, you can adjust the resolution.
>
>...int( (hour(datetime)*60+minute(datetime) )/15 )
>will give a count of events during a 15 minute period. don't expect any 0's to be returned. if there is no data during that time, there will be no summary of data of that time.

Good point....was working off the top of me head....
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform