sql server中的日期问题和excel很重要 [英] date issue in sql server and excel important

查看:116
本文介绍了sql server中的日期问题和excel很重要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好





我有一张excel表格,其日期格式为dd-mm-yyyy和其他数据。我试图通过importdata将其插入到sql server 2005表中。当我这样做时,数据作为yyyy-mm-dd插入到sql表中。请记住,sql 2005不存在日期时间类型。



当UI应用程序运行并且人们立即生成条目时...相同的日期列将作为dd-mm-插入YYYY。



然而搜索失败...我想要excel中的条目和通过UI制作的新条目都坚持dd-mm-yyyy格式。因此,搜索可以是统一的,也不会失败。



如果有办法我可以将表格中从excel导入的格式更改为dd-mm格式-yyyy。请告诉我怎么做。



请帮助。

Hello


I have an excel sheet with dates in format dd-mm-yyyy and other data. I am trying to insert this into sql server 2005 table via importdata. When i do this , the data gets inserted as yyyy-mm-dd into the sql table. Keep in mind datetime type doesnt exist for sql 2005.

When the UI application runs and people make entries now..the same date column gets inserted as dd-mm-yyyy.

However search fails...I want both the entries in excel and the new entries made via UI to stick the dd-mm-yyyy format. So that search can be uniform and will not fail.

if there is a way I can change the imported from the excel in the table to the format of dd-mm-yyyy.Please let me know how to do it.

Please help.

推荐答案

请记住,sql 2005不存在日期时间类型。



你在做什么?

当然SQL2005包含DateTime数据类型!

http: //technet.microsoft.com/en-us/library/ms187819(v=sql.105).aspx [ ^ ]



这显然是什么正在使用:否则你不会在SQL数据中看到ISO格式的日期。



我认为你需要查看你的搜索代码:问题是最多的很可能......
"Keep in mind datetime type doesnt exist for sql 2005."

What are you taking about?
Of course SQL2005 includes the DateTime data type!
http://technet.microsoft.com/en-us/library/ms187819(v=sql.105).aspx[^]

And that is clearly what is being used: otherwise you wouldn't be seeing ISO format dates in the SQL data.

I think you need to look at your search code: the problem is most likely there...


这篇关于sql server中的日期问题和excel很重要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆