Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Order Event Times from AM to PM?
Message
 
To
09/04/2001 16:15:42
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00493754
Message ID:
00493763
Views:
18
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform