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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
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


[TABLE="width: 336"]
<colgroup><col><col span="3"></colgroup><tbody>[TR]
[TD="align: center"]Date[/TD]
[TD="align: center"]Batch[/TD]
[TD="align: center"]Reference[/TD]
[TD="align: center"]School[/TD]
[/TR]
[TR]
[TD="align: center"]11/05/2015[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]01 St Aidans NS[/TD]
[/TR]
[TR]
[TD="align: center"]12/05/2015[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]01 St Aidans NS[/TD]
[/TR]
[TR]
[TD="align: center"]13/05/2015[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]01 St Aidans NS[/TD]
[/TR]
[TR]
[TD="align: center"]14/05/2015[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]01 St Aidans NS[/TD]
[/TR]
[TR]
[TD="align: center"]15/05/2015[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]01 St Aidans NS[/TD]
[/TR]
[TR]
[TD="align: center"]11/05/2015[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]01 St Aidans NS[/TD]
[/TR]
[TR]
[TD="align: center"]12/05/2015[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]01 St Aidans NS[/TD]
[/TR]
[TR]
[TD="align: center"]13/05/2015[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]01 St Aidans NS[/TD]
[/TR]
[TR]
[TD="align: center"]14/05/2015[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]01 St Aidans NS[/TD]
[/TR]
</tbody>[/TABLE]
 
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,223,275
Messages
6,171,121
Members
452,381
Latest member
Nova88

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