Brad,
I tried your suggestion and worked it further as shown:
SELECT ;
iif(right(substr(time,1,2),1)=":", padl(substr(time,1,1),2,"0"),substr(time,1,2));
+ iif(at("AM", time)=0,"PM","AM");
+ iif( at(":", time)=2, substr(time,3,2), substr(time,4,2) ) AS timesort,;
* ;
FROM ;
PROPOSAL ;
ORDER BY ;
date, timesort ;
INTO ;
CURSOR c_PROPOSAL
It seems that this puts me on the right track with "timesort" substituted for "time" in the ORDER BY and printing the actual time values from the "Time" field but the timesort field is showing all xxPMxx times first in the column before the xxAMxx times, so I still have some work to do here to get it correct.
Thanks for your response.
Mark
>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
Mark Rietman