I have a date column in table that was imported as text Ex: 20020705. That reads the fifth of July 2002. I am tiring to have it look like this format in the column. 05/07/2002. JI have tried Cdate, DateSerial. But with no luck L appreciate any help.
If they are always 8 digits, then you should be able to use something like:
strDate=range("A5" 'to convert the date in A5
iDay=val(mid(strDate,7))
iMon=val(mid(strDate,5,2))
iYear=val(left(strDate,4))
range("A5"=dateserial(iYear,iMon,iDay)
range("A5".numberformat="dd/mm/yyyy"
You can put this code inside a loop that tackles all of your afflicted cells one by one. Rob
Try an update query... I created a small database with five records in one column and an empty column waiting for the converted output. ImportData was the column with the data and ConvertData was the empty 'receptacle'. On the Query tab I designed a new query, added my table, clicked on both fields to add them to the design grid, then selected "UPDATE QUERY" from the Query menu item. On the third line of the design grid under ConvertData I typed:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.