Results 1 to 5 of 5
  1. #1
    shabar is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2013
    Posts
    66

    Data Conversion Issue

    Hi All






    I have following two columns as text data type in table T1


    Col1
    23-Nov-2005 02:02:19 PM
    31-Oct-2005 04:07:05 PM
    31-Oct-2005 04:06:46 PM
    06-Dec-2005 02:14:05 PM


    Col2
    01-Jan-2006 12:00:00 AM
    01-Jan-2006 12:00:00 AM
    01-Jan-2006 12:00:00 AM
    01-Jan-2006 12:00:00 AM
    01-Jan-2006 12:00:00 AM




    After running the following querys I get different data formats eventhough the data type has change to date/time


    ALTER TABLE T1 ALTER COLUMN T1.Col1 DATETIME




    ALTER TABLE T1 ALTER COLUMN T1.Col2 DATETIME








    Col1
    23-Nov-2005 02:02:19 PM
    31-Oct-2005 04:07:05 PM
    31-Oct-2005 04:06:46 PM
    06-Dec-2005 02:14:05 PM






    Col2
    01-Jan-2005
    01-Jan-2005
    01-Jan-2005
    01-Jan-2005
    01-Jan-2005




    What could be the reason. I need Col1 also same format as Col2






    Cheers




    Shabar

  2. #2
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    col1 is being set as datetime
    col2 is being set as date

    if you do it manually do you get the same results?

  3. #3
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    The issue is Excel and Access look at Date Time values as numbers. Formatting make them appear as we wish. For the col2 values, there is no decimal because Midnight is Click image for larger version. 

Name:	dateTime.png 
Views:	7 
Size:	28.8 KB 
ID:	10950Zero hour.

  4. #4
    alcapps is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jan 2012
    Posts
    292
    good catch, I didn't see the part where the columns where text to start.

  5. #5
    shabar is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2013
    Posts
    66
    alansidman


    Thax a lot for the clarification


    Cheers

    Shabar

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Issue getting data organized
    By laughingman1906 in forum Import/Export Data
    Replies: 1
    Last Post: 11-18-2012, 04:45 PM
  2. Data Type Conversion Error
    By graviz in forum Forms
    Replies: 7
    Last Post: 06-04-2012, 11:34 AM
  3. Data Sorting Issue
    By phd42122 in forum Access
    Replies: 5
    Last Post: 04-27-2012, 01:04 PM
  4. Data Connection Issue
    By shexe in forum Reports
    Replies: 2
    Last Post: 09-22-2010, 01:21 PM
  5. Data Type Conversion in Query
    By EHittner in forum Queries
    Replies: 3
    Last Post: 04-14-2010, 02:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums