Adding "H:mm:ss" values in one field to a DATE field

Answered

Comments

3 comments

  • Official comment
    Brian Junio

    Mario,

    Good afternoon!

    First, we'll need to convert the DATE into a STRING while stripping the existing TIMESTAMP:

    • FORMATDATE(#DateValue;"MMM dd, Y")

    Next, we can concatenate the STRING output from above with the TIMESTAMP already represented as a STRING:

    • CONCAT(#FormatDateOutput;" ";#TimeValue)

    The output from the above will be what you are looking for, but represented as a STRING (E.g. "Dec 27, 2019 17:01:00"). Should you be outputting to something that does not care about the casting of this value, you can call it good here.

    If you would like to convert the STRING output back into DATE format, you can use the following:

    • ASDATE(#ConcatOutput;"MMM dd, Y HH:mm:ss")

    Finally, you can do all of the above in one wrapped function.  The first will convert back to DATE while the second will remain in STRING format:

    • ASDATE(CONCAT(FORMATDATE(#DateValue;"MMM dd, Y");" ";#TimeValue);"MMM dd, Y HH:mm:ss")
    • CONCAT(FORMATDATE(#DateValue;"MMM dd, Y");" ";#TimeValue)

     

    Cheers,

    Brian

    Comment actions Permalink
  • Mario Valdes II

    Thank you, Brian!! I won't be back to work until Monday, so can't try it until then, but thank you for the quick response; I'm sure it'll work!!

    1
    Comment actions Permalink
  • Mario Valdes II

    Good afternoon, Brian,

     

    Happy to report your solution appears to have worked! Thanks again!

    1
    Comment actions Permalink

Please sign in to leave a comment.