Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    1

    Unanswered: Couple of Questions, Import and Time difference

    Hi,

    I am new to access and have a coople of questions:

    When I import a spreadsheet from Excel, it has 4 coulms, 2 Dates and 2 Times. When in Access the Dates have a Time (12:00AM) by the time, and the Times have a date, which is not the same as the date, in th date coulmn, and if no time 0:00 is displayed.

    I only want the date and time, and if blank leave blank.

    The columns have DateA and TimeA, DateB and TimeB, I want to be able to subtract DateB and TimeB away from DateA and TimeA, thus giving me the difference betweeen the two in hours and minutes. The dates may be more than 24 hours aprart, so it has to coupe with up to the difference of up to 4 days.

    DateB TimeB DateA TimeA
    22/4/2004 01:00 - 20/4/2004 00:55 should equal 48:05

    Thanks nel

  2. #2
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    Did you think about merging Date and Time values in same field and use DateDiff() function to resolve difference between them?
    DateTimeB, DateTimeA
    Hours=DateDiff("h", DateTimeB, DateTimeA) 'will gove you hour difference
    Minutes=DateDiff("n", DateTimeB, DateTimeA) mod 60 'will give you remaining minutes.
    ghozy.

Posting Permissions

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