Skip to Content

Agentry Update Rules - Date Substring

Dear all,

I have a question on how to do a substring in Agentry Rules. I'm getting the below values from SAP, and I need just dates.

12:00:00 AM 5/12/2017

3:20:29 PM 12/12/2016

If I get the same number of length, I could able to substring (using MID function I guess), but I'm getting different format. So I need to write something like take everything after "M" (so it covers AM /PM) and return the rest of the string till end. Can you help me out in achieving this? Sorry for such dumb question.

Thanks,

Justin.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 09, 2017 at 01:47 AM

    If the value from SAP is a string you can use the DATETIME rule function to first parse the string into a date and then format it out as your desired date format.

    --Bill

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 14, 2017 at 02:07 PM

    Hi Justin,

    Another workaround to acomplish this, you can extend your object class and send to agentry those values separated. If you see at your java code you will see that your are getting the values from two different sap fields but this values are getting concatenated at java code and sent to Agentry as one propety (DATEANDTIME)

    Regards!

    Add comment
    10|10000 characters needed characters exceeded