Re: Medium time conversion, sort



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

.



Relevant Pages

  • Re: Two more farms?
    ... A sort of sanity ... I am curious as to how Pat would react. ... Jim obviously lobbies ... Jill is an egocentric cut and paste merchant ...
    (uk.business.agriculture)
  • Re: Novice needs help - solution questions
    ... > Jim Y wrote: ... I don't know enough about DAO database programming to ... > don't think that it is a bug that you have, ... > I would strongly suggest that you start again, preferable using the DAO ...
    (microsoft.public.vb.database.dao)
  • Re: Code for ADO.NET: The Complete Reference
    ... It involves SQL Server 2000 and ... connect to a Database in SQL will not run and get the error. ... Jim ... website BUT when I go to the Osborne website and enter this ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Novice needs help - solution questions
    ... Jim Y wrote: ... I don't know enough about DAO database programming to ... don't think that it is a bug that you have, ... "bug fix" of destroying a form does not cause more issues, ...
    (microsoft.public.vb.database.dao)
  • DB does not save all 3 tables - VB6 & DAO 3.6
    ... Jim Y ... I made a copy of the database and took it home - a 10 minute drive. ... Using Visdata, I was able to ... Is there a program or code that I can give the business to fix that problem? ...
    (comp.lang.basic.visual.misc)