导入导出向导疑问 [英] Import Export Wizard doubt

查看:73
本文介绍了导入导出向导疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

- 在我的excel表中,数据是这样的



  userid   starttime   endtime  
51393154 8/26/13 6:45 2013年8月26日 17:00
51359728 8/26/13 6:45 8/26/2013 17:00
51317189 8/26/13 6:45 8/26/2013 17:00
51352736 8/26/13 6:45 2013年8月26日 17:00
51396793 8/26/13 6:45 8/26/2013 17:00





如果我点击开始时间或日期时间的任何单元格我会在顶部知道它

8/26/2013 6:45:00 AM





- 然后我继续通过导出导入向导在表格中插入数据..



- 数据已成功插入...



但我得到的数据如下:



userid starttime endtime

51393154 8/26/2013 6:45:00 AM 8/26/2013 5:00:00 PM



- 我不想要这些AM或PM部分。如何解决这个问题?

解决方案

恐怕你不能在向导本身那样做。

尝试在导入操作后转换值。



 选择 cast('  8/26/2013 5:00:00 PM'  as  日期时间


--In my excel sheet the data is in this way

userid      starttime          endtime
51393154    8/26/13 6:45    8/26/2013 17:00
51359728    8/26/13 6:45    8/26/2013 17:00
51317189    8/26/13 6:45    8/26/2013 17:00
51352736    8/26/13 6:45    8/26/2013 17:00
51396793    8/26/13 6:45    8/26/2013 17:00



if i click on any any cell in starttime or datetime i get to know in top its
8/26/2013 6:45:00 AM


--Then i proceed and insert the data in the table through export import wizard..

--data gets successfully inserted...

But i get the data as like this :

userid starttime endtime
51393154 8/26/2013 6:45:00 AM 8/26/2013 5:00:00 PM

--I dont want these AM or PM part. How to solve this ?

解决方案

I am afraid you cant do that in Wizard itself.
Try Casting the value after the Import operation.

select cast('8/26/2013 5:00:00 PM' as datetime)


这篇关于导入导出向导疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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