Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Order Event Times from AM to PM?
Message
 
À
09/04/2001 16:15:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00493754
Message ID:
00493763
Vues:
17
Assuming all data is in XX:XX?M or X:XX?M format, you could do:
SELECT ;
  LEFT(PADL(timefield,7),2)+RIGHT(PADL(timefield,7),2)+SUBSTR(PADL(timefield,7),4,2) AS timesort,;
  * ;
FROM ;
  mytable ;
ORDER BY ;
  1 ;
INTO ;
  CURSOR result
This will construct a "timesort" field that will consist of the Hour, then the AM/PM part, then the minutes. So 10:45AM will come out "10AM45" and 7:30AM will come out " 7AM30"

Then you can do a COPY TO...FIELDS to copy out only the fields that you want in your final file.

Will this work for you?

--Brad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform