ODBC linked table not showing fractions of seconds

2019-07-29 21:37发布

I have linked an IBM informix database table through an ODBC connection to an Access 2010 database. My issue is that the date field in this table only shows dd/mm/yy HH:nn:ss in the Access view, where the stored data is to 1000th of a second.

I can show this in Excel 2010 but not in Access 2010: is this possible? Not having this level of accuracy is preventing me making accurate calculations!

1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-07-29 22:11

There is a similar question on another forum here. The Date/Time field type in Access does not store fractions of seconds, and linked tables implicitly cast their columns to the corresponding Access data type, so the fractions of seconds are not available in a linked table even though they are stored in the remote database.

For example, I have a SQL Server database with a table named dbo.linkedTable that has a datetime column with fractions of seconds:

datetime.png

If I create a linked table in Access the [datetimeCol] is mapped to the Date/Time field type in Access and the times are rounded to the nearest second

linkedTable.png

As a workaround, I can create a Pass-Through query that uses T-SQL to convert the datetime value to a string...

SELECT ID, CONVERT(varchar, datetimeCol, 21) AS strDatetime FROM dbo.linkedTable

...returning...

strDatetime.png

...and I can parse the [strDatetime] string value to retrieve the fractional seconds.

查看更多
登录 后发表回答