Time values changing from excel to access - NEED HELP

Maven4Champ

Board Regular
Joined
Jun 10, 2004
Messages
57
I am running into a big problem when importing data from a spreadsheet and into an Access database. Currently, I have columns of data which display time of minutes/seconds in the mm:ss format. For instance, on row in a column might say 00:34 which means 34 seconds.

Upon importing it into Access, the Default Date/Time is set for the Data Type in my table. The format of the Date/Time is Medium Time - however this changes the value shown in my report and in my table as 00:00 or when I click inside the cell it shows its value as 12:00:53 AM.

Is there any kind of formula or modification I can make within Access to keep my value of 00:34 in tact w/out it changing?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
mdmilner said:
How exactly are you importing this data into Access?

Mike

File>Get External Data>Import -

Then I import the .xls - set the first row as the column header and go next next finish and it imports it.

TimeLine: Format([TimeIn],"Short Time") & "-" & Format([TimeOut],"Short Time") & (DateDiff("n",[TimeIn],[TimeOut])/15) & " Qtrs"

and instead of it importing the time as mm:ss it imports it as hh:mm:ss Short Time in Access which causes me to lose the seconds essentially.

Again, for instance my Avg External Call Time value will show as 0:12 in an Access cell.
Upon clicking inside the cell, the value shows at 12:12:09 AM. I need it to show 12:09 or 00:12:09 as the value instead.
 
Upvote 0
It appears "for now" that I might have solved my own question...

If I go into Table Properties and set the Data Type as Date/Format - I am then given the format options specifically for that data. instead of choosing medium time, long time, short time, date, etc. I typed in mm:nn:ss and saved it. I then opened back up the Table in datasheet view and it now reports it as hh:mm:ss with the minute and second variable in tact!

Was this the best way to do it?
 
Upvote 0
CentreVue Time Format


Here is my example...
Notice how on the right, the time lists correctly from AM to PM?

On the left, in the first column, it reads it as AM when it should read PM.

Now here is something. Our reports are from 7am to 7pm - maybe sometimes 7:30pm

Is there a way or code to set it where anytime 1:00/2:00/3:00/4:00/5:00/6:00 is present in the spreadsheet, it is recognized as PM instead of AM? I say this because those times will never be in our report because again, our report starts at 7am so those times have already passed in AM?

I figure I could do it either in Excel or Access - whichever is possible?[/url]
 
Upvote 0
Go back two posts. Looks like you were typing before I'd left my note.
If I understood your post, you'd fixed the problem by formatting the field.

Aka, the correct data was there, it just wasn't displaying properly.

"That's Perfect" fits because

1) You did it yourself
2) Field formatting is the easiest way to fix things. Lots of time you don't need complex programming for tasks that really can be simple.

Mike
 
Upvote 0
mdmilner said:
Go back two posts. Looks like you were typing before I'd left my note.
If I understood your post, you'd fixed the problem by formatting the field.

Aka, the correct data was there, it just wasn't displaying properly.

"That's Perfect" fits because

1) You did it yourself
2) Field formatting is the easiest way to fix things. Lots of time you don't need complex programming for tasks that really can be simple.

Mike

Yes, I did fix it by putting 0.5 in a cell in Excel, then copying, Paste Special (check Values and check Add) and then it sets them to PM.

My lingering problem is my boss wants the export of this data from CentreVu and Import into Access to be as seamless as possible (not messing around in Excel much).

So my question is, is there a way to format this data after it has been imported into Excel and is being read as AM when it is really PM?

If so, that would be the best route.

I import the data from Excel, and apply a formatting or run a macro or module or something that applies certain conditions or formats or formulas to the data so it is seamless (instead of editing individual records in Excel before importing...

Does that make any sense or am I talking myself in a circle?
 
Upvote 0
Is it possible to create an IIF function that does the following

When 'Time To' equals PM value, change 'Time From' to PM value if value is after 1:00 or greater?
 
Upvote 0

Forum statistics

Threads
1,221,707
Messages
6,161,411
Members
451,704
Latest member
rvan07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top