How to convert a text field to a date/time field in Access 2010?

别等时光非礼了梦想. 提交于 2019-12-02 05:30:47

You can use left, right and mid string functions to construct a date from the various parts of the string.

For example:

DateSerial(Left(MyTextDate,4),Mid(MyTextDate,5,2),Right(MytextDate,2))

You can use the above in an Update query to update a date type coulmn 9field) to a the date from the text column.

Todd

My date came in as text looking like this:"2013-03-23 00:00:00.0"

I take the left 10 characters only, "2013-03-23", this makes it so Access can recognize it is a date field and then I just switch around the format.

Format(Left([WEEKEND],10),"m/d/yyyy")
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!