+ Reply to Thread
Results 1 to 3 of 3

Change Table Field Data Type To Date

  1. #1
    Registered User
    Join Date
    03-13-2009
    Location
    Malta
    MS-Off Ver
    Excel 2003
    Posts
    59

    Change Table Field Data Type To Date

    Hello,

    I was wondering how you can change the data type in a field to Date/time rather then just text using VBA.

    I assembled the following code, but am not getting any results. If someone could help me out I would appreciate it.


    Table Name: tblATB_1
    Field name to format: Due_Date
    Data Type Desire: Date/Time
    Format: MM-DD-YYYY


    Please Login or Register  to view this content.

    Thank you in advance

  2. #2
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: Change Table Field Data Type To Date

    Hi,

    Click Here - to view Field Type References

    and

    Click Here - for some examples

    Hope this helps,

    Dan
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!

  3. #3
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74

    Re: Change Table Field Data Type To Date

    Just my 0.02c worth.

    I had a text field that held dates. I also had people from

    Germany 04/07/2010
    Japan 2010-07-04
    China 2010/07/04
    USA 07/04/2010

    entering dates in this field. The problem that I was worried about is how Access or the database would deal with the above.

    In the end I did this manually, be creating a new column with type Date. Then I opened a record set of all records and copied each one accross. If Access could not handle the string when putting it into the date field I would get an error and could then come back to fix them up. The US ones (where the day was greater than 12) errored in my case as my Database was sitting in Germany with a german date system. Also the ones less than 12 were also wrong.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1