Results 1 to 3 of 3
  1. #1
    Batta2019 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    17

    Converting strings to date

    Surprisingly, I found that someone was saving date as STRING in the following form 12/JAN/2019. I need to convert this to a regulardate format 03/29/2019 so I am able to compare the dates from these two columns (please check bellow). Any idea how to do that. Your help is much appreciated.Thanks.

    Col1 Col2


    12/JAN/2019 03/29/2019


    Col 1 Col2
    12/JAN/2019
    03/29/2019

  2. #2
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    CDate("12/jan/2019") will convert to a date as 01/12/2019
    If it's in a string variable you can convert that:
    CDate(myDate)

    If you want to first verify that it's an acceptable format you can use the IsDate function which returns true/false
    If IsDate(myDate) = True then...

  3. #3
    Batta2019 is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2019
    Posts
    17
    Thank you Sir!

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

Similar Threads

  1. Replies: 4
    Last Post: 04-27-2017, 07:52 AM
  2. Replies: 7
    Last Post: 12-26-2014, 12:17 PM
  3. Date converting
    By Rzadziu in forum Queries
    Replies: 4
    Last Post: 02-03-2014, 05:54 AM
  4. Converting DATE & Time
    By johnseito in forum Access
    Replies: 8
    Last Post: 10-05-2013, 10:28 AM
  5. Replies: 8
    Last Post: 02-22-2012, 11:58 AM

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