Results 1 to 9 of 9
  1. #1
    P5C768 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95

    Update query for 12/30/1899 dates

    I am trying to run an update query to get rid of blank dates that are showing up as 12/30/1899, but when you click on the value in the table, it switches to 12:00:00 am.



    Why would my update query miss some values?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The field is not blank. It contains 0.0 which equates to Midnight on 12/30/1899. Here's a link that might help in understanding the DateTime field a little better.

  3. #3
    P5C768 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95
    Sorry, I should clarify. I hvae an update query that should replace 12/30/1899 or 0.0 or 12:00:00 am with " ". The first time I ran it, it replaced ~400 values.

    However, when I go into the table, some records still display 12/30/1899. When I try to rerun my update query, it displays a message saying that I am about to over write 0 records.

    I'm wondering how to get my query to replace all records in a field that have 12/30/1899 or 0.0 or 12:00:00 am with " ".

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    A DateTime field is numeric and will not accept a string such as " ".

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It might allow you to set it back to a Null however, but I'm not sure.

  6. #6
    P5C768 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95
    It does allo me to use Null as the Update to field, but I think the problem is that my query isn't finding all instances of 0.00 dates. I have tried using or to search for 0.00, 0 and 12/31/1899, but it still says all fields have been fixed. Any reason the query would miss some values? Could they be in a 0.000000 format or something similar?

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Post the SQL for your Update query so we can look at it.

  8. #8
    P5C768 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Aug 2009
    Location
    Denver, CO
    Posts
    95
    I think this issue is resolved, but I may have another question. The problem isn't actually with dates that are 0.0. I imported the data from excel, and some of the dates are text fields (i.e. 12312007). Is there a way to convert these to dates in access? I am thinking I will need to fix them in excel and reimport.

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    There are certainly way to convert a string date to a DateTime value but the import should give you some problems because of the different field types. I would tend to fix it in Excel unless this will be happening often. In that case, import everything as text and fix it in Access.

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

Similar Threads

  1. Update query help!!!
    By GUMUBIBI in forum Queries
    Replies: 4
    Last Post: 09-07-2009, 09:09 AM
  2. Help with update query
    By weirdg in forum Queries
    Replies: 0
    Last Post: 09-03-2009, 04:21 AM
  3. Matching Query Dates
    By rgwynne in forum Queries
    Replies: 1
    Last Post: 08-13-2009, 05:23 AM
  4. Update Query
    By GrnISSO in forum Queries
    Replies: 0
    Last Post: 06-15-2007, 05:41 PM
  5. Update Query
    By canadian1121 in forum Queries
    Replies: 1
    Last Post: 11-15-2005, 04:04 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