If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
From Text to Date/Time
Using a macro, I am importing a text file into an access table. I have a
query which reformats the date fields into the proper format, but now I need a way to change the field type from text to date/time. Can this be done using a macro? All help much appreciated! |
#2
|
|||
|
|||
No, it can't. Changing field types isn't that straightforward at the best of
times, and a macro certainly isn't capable of it. The usual way is to add a new field, of the correct type, to your table, run an Update query to transfer the data from the old field to the new field, delete the old field and rename the new field. This is actually what Access does under the covers when you make such changes through the GUI. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Deb" wrote in message ... Using a macro, I am importing a text file into an access table. I have a query which reformats the date fields into the proper format, but now I need a way to change the field type from text to date/time. Can this be done using a macro? All help much appreciated! |
#3
|
|||
|
|||
Doug,
So are you saying there is no possible way to automate those sequence of events as a macro? What about in VBA? "Douglas J. Steele" wrote: No, it can't. Changing field types isn't that straightforward at the best of times, and a macro certainly isn't capable of it. The usual way is to add a new field, of the correct type, to your table, run an Update query to transfer the data from the old field to the new field, delete the old field and rename the new field. This is actually what Access does under the covers when you make such changes through the GUI. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Deb" wrote in message ... Using a macro, I am importing a text file into an access table. I have a query which reformats the date fields into the proper format, but now I need a way to change the field type from text to date/time. Can this be done using a macro? All help much appreciated! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A challenging question on text boxes-word 2000 | fw76 | Page Layout | 16 | October 18th, 2004 11:45 PM |
find a date on sheet 2 and count text in that column | jtinne | General Discussion | 4 | October 4th, 2004 09:06 PM |
Too many hyperlinks? | [email protected] | Powerpoint | 7 | May 25th, 2004 02:19 AM |
Column separator crosses through wrapped text box | Bob S | Page Layout | 0 | April 25th, 2004 09:52 PM |
Extracting text | Nemo | Worksheet Functions | 3 | April 6th, 2004 02:33 PM |