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

后端 未结 2 746
失恋的感觉
失恋的感觉 2021-01-23 14:42

I am importing an excel file into Access 2010 and the date field(CALLDATE) comes in as text(YYYYMMDD). I would like to use an update query to update a new field \"dateofcall\"

2条回答
  •  故里飘歌
    2021-01-23 15:27

    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.

提交回复
热议问题