Re: Medium time conversion, sort
- From: "Jim Mack" <jmack@xxxxxxxxxxxxxxx>
- Date: Sat, 4 Mar 2006 12:37:20 -0500
Jim Y wrote:
Time and date are confusing for me. I have a form in which the user
enters the time with 3
ListBoxes - 1 for the hour (1-12), 1 for the minutes (5 min.
increments), 1 for AM or PM. The time
is displayed in a label (PickUpTime 1) on a second form. I had been
storing it in an Access
database as text, but now I want to be able to sort the PickUpTime 1
times for a specific date.
.............
The database field is designated as text and not time for this entry.
Must I change the database or
is there a work around?
In the long run the best thing to do is to convert the field to a Date type.
For sorting of just a few values, though, the answer can be as simple as using any sort (say, a bubble sort), and comparing times, but swapping strings.
Every sorting routine has a place where elements are compared, and a place where elements are swapped. Just do this at those points:
If CDate(datestring1) > CDate(datestring2) Then
'swap datestring1, datestring2
--
Jim Mack
MicroDexterity Inc
www.microdexterity.com
.
- References:
- Medium time conversion, sort
- From: Jim Y
- Medium time conversion, sort
- Prev by Date: Medium time conversion, sort
- Next by Date: Re: Help with calling a function that returns a collection
- Previous by thread: Medium time conversion, sort
- Next by thread: Re: Medium time conversion, sort
- Index(es):
Relevant Pages
|