Results 1 to 3 of 3
  1. #1
    swenger is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    151

    Convert String to Date

    I am linking with ODBC to another database where the dates are being stored as a string but with a time. Here is an example 2014-10-20 04:00:00



    I would like to convert this to a short date. If i use Cdate() it works but the records which don't have anything come up as #Error

    Whats the simplest way to deal with this. Ideally I would like to do this in the query as I have one query which reads this table and all my other queries and forms are based off this one query.

    Thanks

    Sam

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    IIf(Not IsNull(datefield),CDate(datefield))

  3. #3
    swenger is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Mar 2016
    Posts
    151
    Thanks for your help

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

Similar Threads

  1. Convert String to Date in Query
    By McArthurGDM in forum Access
    Replies: 15
    Last Post: 06-22-2015, 10:52 AM
  2. Convert String to Date in Web App
    By carlo76 in forum SharePoint
    Replies: 3
    Last Post: 03-06-2015, 11:05 AM
  3. Convert Text String to Date in SQL
    By kestefon in forum Access
    Replies: 2
    Last Post: 12-04-2013, 03:33 PM
  4. How to convert Date to String?
    By thebaul in forum Access
    Replies: 1
    Last Post: 08-01-2012, 05:51 AM
  5. Convert string to date
    By ~SwAmPdOnKeY~ in forum Queries
    Replies: 4
    Last Post: 09-11-2008, 07:19 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