Linked table field not picking up correct data type from excel

gerryg

New Member
Joined
Aug 22, 2011
Messages
10
Hi,

So as the title indicates i have an access application whereby i have a linked table pulling data from an external excel sheet (.xls). One of the columns within the excel sheet holds a date in the format dd/mm/yyyy. The issue is that the linked table seems to be picking up that the data type of this column is "Text", and unfortunately this is a big issue as i need to create querys using this date attribute (i.e. > Date() +1 etc). I am using Access 2007. Any help appreciated. :confused::confused:
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
How is the column formatted in Excel (as Text or Date)?
Are there any blanks in that column in Excel?
 
Upvote 0
Are you regional settings set for the UK (and not the US)?
See: https://support.office.com/en-za/ar...ta-types-edf41006-f6e2-4360-bc1b-30e9e8a54989

If so, can you post what you first ten rows of data look like for this Excel file?

The regional settings are set to UK on my laptop.

The following are the first 10 records


DateBatchReferenceSchool
11/05/20151101 St Aidans NS
12/05/20151101 St Aidans NS
13/05/20151101 St Aidans NS
14/05/20151101 St Aidans NS
15/05/20151101 St Aidans NS
11/05/20151201 St Aidans NS
12/05/20151201 St Aidans NS
13/05/20151201 St Aidans NS
14/05/20151201 St Aidans NS

<colgroup><col><col span="3"></colgroup><tbody>
</tbody>
 
Upvote 0
Let's say that you first entry is in cell A2 in Excel. What does this Excel formula return?
=ISNUMBER(A2)
(change A2 to the cell with your first date in it).
 
Upvote 0
That means that the dates you have in Excel have been entered as Text, and not as Dates, which explains why you are seeing them as Text in Access.

You will need to convert them to dates in Excel first before linking the file.
You can do that by changing the format of the column first, and then doing a "Text to Columns" on that data column, and in the third argument selecting the approproate Date option (specifically, the DMY one), and clicking Finish.
 
Upvote 0
That means that the dates you have in Excel have been entered as Text, and not as Dates, which explains why you are seeing them as Text in Access.

You will need to convert them to dates in Excel first before linking the file.
You can do that by changing the format of the column first, and then doing a "Text to Columns" on that data column, and in the third argument selecting the approproate Date option (specifically, the DMY one), and clicking Finish.

Worked perfectly :):):):)

Thank you
 
Upvote 0

Forum statistics

Threads
1,221,869
Messages
6,162,533
Members
451,773
Latest member
ssmith04

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