Results 1 to 4 of 4
  1. #1
    NOTLguy is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Sep 2010
    Posts
    60

    Converting dates from a field with blank records

    I am using an update query to convert numerical dates ( eg. 34787 ) imported from Excel to a new field ( Access type date/time ). Not all the fileds have data so the query bombs out. How can I avoid that. Any help would be appreciated.

    Old field name - DeathDate
    New field name - DDate

    Query: UPDATE Clients SET Clients.DDate = CDate([DeathDate]);



    Thanks,
    Bill

  2. #2
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    Add a WHERE statement:

    UPDATE Clients SET Clients.DDate = CDate([DeathDate]) WHERE [DeathDate] Is Not Null;

    (You might need the source info for [DeathDate] -- [TABLE].[DeathDate])

  3. #3
    NOTLguy is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Sep 2010
    Posts
    60
    Quote Originally Posted by slave138 View Post
    Add a WHERE statement:

    UPDATE Clients SET Clients.DDate = CDate([DeathDate]) WHERE [DeathDate] Is Not Null;

    (You might need the source info for [DeathDate] -- [TABLE].[DeathDate])
    Thank you for the quick reply. That worked. I really appreciate your help.

    Regards,
    Bill

  4. #4
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    My pleasure

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

Similar Threads

  1. Update dates for multiple (not all) records
    By thekruser in forum Access
    Replies: 2
    Last Post: 08-30-2010, 05:27 PM
  2. Counting Active Records Between 2 Dates
    By catat in forum Queries
    Replies: 5
    Last Post: 07-28-2010, 10:55 AM
  3. Replies: 2
    Last Post: 07-03-2010, 08:45 PM
  4. Replies: 3
    Last Post: 04-26-2010, 11:38 AM
  5. Replies: 5
    Last Post: 09-16-2009, 05:22 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