If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Couple of Questions, Import and Time difference

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-24-04, 20:38
nel nel is offline
Registered User
 
Join Date: May 2004
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 06-04-04, 16:48
ghozy ghozy is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On