cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert SAP Date (text format in DD.MM.YYYY ) into blueprism date field

Praveen_Kumar_C
Level 3
Dear Community,

I am reading some date values from SAP screen using codestage with VBA. Currently I am exporting to text field and it's format is DD.MM.YYY  . Later point I need this date to calculate date differences. Thus I need to convert this text field into blue prism date field. 

I can do this by splitting the multi calc stage using text splitting and makedate function. But is there any more easy way to do in VBA using CDate function by passing text field and input date format 'DD.MM.YYYY' ?


------------------------------
Praveen Chitturi
------------------------------
Praveen Chitturi
2 REPLIES 2

Hi Praveen,

Yes in VBA you can use Cdate function to convert any text date into proper date format.

You can use ToDate function under Functions -> Conversion - > (Just pass the date in text box and click on paste)

I hope its work for you,If yes please mark this ans as best ans.

Thanks
Nilesh

------------------------------
Nilesh Jadhav
Senior RPA Specialist
------------------------------
Nilesh Jadhav.
Consultant
ADP,India

Hi @Nilesh Jadhav,

Thanks for kind support. I tried CDate in VBA but it is giving error something related to date format. So what I have done is I've created an reusable action in the object to convert. So that next requirement we can use this. 

Inputs:-
1. Date in text type
2. Text Date format ( it can be DD.MM.YYYY (or) MM.DD.YYYY (or) any format which should have DD , MM, YYYY )

Logic:- 
1. Dynamically split Text date into DD, MM, YYYY text variables based on the format. 
2. Use MakeDate() to combine into the Output Date field
12200.png

Output:-
1. Date in BP Date data type


------------------------------
Praveen Chitturi
------------------------------
Praveen Chitturi