locked
convert text to datetime RRS feed

  • Question

  • I have a textbox value '10/17/2017' and '10/01/2017' would like to convert to a datetime value and do a calculation to get the difference of two days.

    Are there any function to convert the text value in the text box to datetime value?

    Your information and help is great appreciated,

    Regards,

    Sourises,

    Tuesday, October 17, 2017 1:49 PM

Answers

  • Hi,

    If you're using VBA, have you tried the CDate() function? For example:

    DateDiff("d",CDate("10/1/2017"),CDate("10/17/2017"))

    Hope it helps...

    • Marked as answer by sourises Tuesday, October 17, 2017 3:23 PM
    Tuesday, October 17, 2017 3:10 PM