Results 1 to 3 of 3

Thread: Time on my mind

  1. #1
    Join Date
    Mar 2006
    Posts
    1

    Unanswered: Time on my mind

    This problem has been driving me to distraction both in Access and Excel and I am sure it can't be just me who has found it.

    As a company I need to process Time.
    Example

    Time on site: 16.15
    Time off site: 16.45
    Time on site: 30 mins

    I add a colomn in the table for time on site and set the format property to Short Time.
    When I type in the time above it will give me an error about incorrect date. If I use a time such as 15.12 it will display it as 15.12.2006.

    If I use a form to do the data entry and set the format to Short time as well I get 00.00 for anything I put in but when you click to cursor in the field it shows you that it is actually storing a date.

    Ideal situation is that I type what I need eg 16.24 and can then use it to do calculations on to get minutes and hours.

    Please help a novice person regain his marbles.

    Using:
    Windows XP Pro SP2, Office XP

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    A has only one appropriate datatype - a datetime.

    if you were to enter
    mm/dd/yyyy hh:mm:ss
    everything would work out fine
    (or since you seem to be using dot separator for dates, try
    mm.dd.yyyy hh:mm:ss)

    UNTESTED:
    if you could persuade (or force via input mask) users to use
    hh:mm
    access would probably cooperate (with possible exceptions over midnight)

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quietly, behind the scenes add a sentinel date to your time when saving. Then the DateDiff function can work for you ... When pulling/displaying the time strip the date off by using the format function ...
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •