简体   繁体   English

ODBC 驱动程序错误地格式化日期字段的问题

[英]Issues with ODBC Drivers formatting date fields incorrectly

I have been having problems with using mulitple ODBC connections with different drivers to linked tables.我在使用具有不同驱动程序的多个 ODBC 连接到链接表时遇到问题。 When I use the ODBC driver 'SQL Native Client 10.0' the dates format correctly (For Example, US Layout, 02/15/2013 ) and within the tables and the dates have a data type of Date/Time.当我使用 ODBC 驱动程序“SQL Native Client 10.0”时,日期格式正确(例如,US Layout, 02/15/2013 )并且在表格中,日期的数据类型为日期/时间。

But when I change the ODBC to an identical connection, but change the driver to SQL Server I notice that within all the linked tables, the data types for Date/Time are changes to Text and the date appears like so - 2013-02-15 00:00:00.0000000 .但是,当我将 ODBC 更改为相同的连接,但将驱动程序更改为 SQL Server 时,我注意到在所有链接表中,日期/时间的数据类型更改为文本,日期显示如下 - 2013-02-15 00:00:00.0000000

I need the SQL Server driver to hold the Date/Time data types.我需要 SQL Server 驱动程序来保存日期/时间数据类型。

Anyone have any idea on how to fix this?任何人都知道如何解决这个问题?

I found out the issue after wrecking my brains.我在绞尽脑汁后发现了这个问题。

The sql server was setup to hold the dates as datetime(2). sql server 被设置为将日期保存为 datetime(2)。 This was changed to datetime and it solved the issue.这已更改为日期时间并解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM