Help With Time Formatting

reo4ua

New Member
Joined
Oct 4, 2017
Messages
3
Hi,

I have a 2013 access db that is pulling info from a 2013 excel sheet that is updated frequently. I had to do some digging to find out how to parse and convert data from one cell into multiple cells so that I could properly query the info in access - all date and time info is in one cell AND the date is in European format - this is what I had to split and fix.

The 2nd time I added new info to the spreadsheet (via import from a 3rd party windows program), I didn't realize that I couldn't just cut and paste the parse/convert formulas into the new cells so I had to go back to the drawing board and figure it out again. Regrettably, the method I used the 2nd time didn't match the first and I think this might be where access is having trouble. I'm not sure why the difference in formatting in excel - word wrap maybe?

How do I get rid of the #NUM ! in access and get it to show the data I know is there?

I've included a few screenshots via the link below.

https://photos.app.goo.gl/vhhSxPssgjWD3bzH3
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
#NUM is where Access is confused on what XL has in a field.
If you want to import a field that is a string, but sometimes its a number (with no chars), i solved this by
running a macro in XL to convert every record to text (via the single quote)

Code:
Public Sub Cvt2Txt()
While ActiveCell.Value <> ""
   If Left(ActiveCell.Value, 1) <> "'" Then ActiveCell.Value = "'" & ActiveCell.Value
   ActiveCell.Offset(1, 0).Select
Wend
End Sub

it scans the column and forces them to be string. My imports work better.

Another way, link the excel as an external table and run append query to a target table. This target table has the field types defined.
the query can also convert any fields if needed like:
CDate(field)
cLng(field)
etc.
 
Last edited:
Upvote 0
Thanks Ranman. I'll give this a shot.


#NUM is where Access is confused on what XL has in a field.
If you want to import a field that is a string, but sometimes its a number (with no chars), i solved this by
running a macro in XL to convert every record to text (via the single quote)

Code:
Public Sub Cvt2Txt()
While ActiveCell.Value <> ""
   If Left(ActiveCell.Value, 1) <> "'" Then ActiveCell.Value = "'" & ActiveCell.Value
   ActiveCell.Offset(1, 0).Select
Wend
End Sub

it scans the column and forces them to be string. My imports work better.

Another way, link the excel as an external table and run append query to a target table. This target table has the field types defined.
the query can also convert any fields if needed like:
CDate(field)
cLng(field)
etc.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,112
Members
452,302
Latest member
TaMere

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