cancel
Showing results for 
Search instead for 
Did you mean: 

How to get just Date instead of Time Stamp

MarinaDutta
Level 5
Dear All,

I want to get just the date value in a collection but I am getting date alon with Time Stamp. How to get only Date.

879.png

------------------------------
Marina Dutta
------------------------------
1 BEST ANSWER

Helpful Answers

Hi Marina,

The reason you are facing this error is because you are trying to convert a whole collection into a single date item which is not possible.

The way you can achive your use case is by first creating an output collection with a date column which would have no rows initially.

Then you need to iterate though your input collection which has all the dates with the time stamps using Loop stage. Then once you are within the Loop stage, add a blank row to your output collection using 'Add Row' action from 'Internal - Collections' VBO and then post this you use a calculation stage and write the expression: ToDate([Sorted Collection.Date column]) and store the same into Output Collection.Date column

Here the names of the collections and the column will depend on how you are defining them in your case, but this is the overall approach that you need to follow.


------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

View answer in original post

5 REPLIES 5

ewilson
Staff
Staff
Hi @Marina Dutta,

If you write the value of the DateTime item into a Date item (i.e. using  Calculation stage) you will get just the date.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

Dear Eric,

I am using the collection item and trying to convert it to Date but getting error. My all the dates are stored in collection called sorted collection.

860.png
861.png

------------------------------
Marina Dutta
------------------------------

Hi Marina,

The reason you are facing this error is because you are trying to convert a whole collection into a single date item which is not possible.

The way you can achive your use case is by first creating an output collection with a date column which would have no rows initially.

Then you need to iterate though your input collection which has all the dates with the time stamps using Loop stage. Then once you are within the Loop stage, add a blank row to your output collection using 'Add Row' action from 'Internal - Collections' VBO and then post this you use a calculation stage and write the expression: ToDate([Sorted Collection.Date column]) and store the same into Output Collection.Date column

Here the names of the collections and the column will depend on how you are defining them in your case, but this is the overall approach that you need to follow.


------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

Dear Devneet Mohanty 

Thank You for your solution. It worked.

Regards,
Marina


------------------------------
Marina Dutta
------------------------------

Glad that your query got resolved @Marina Dutta 🙂

------------------------------
----------------------------------

Regards,
Devneet Mohanty
Intelligent Automation Consultant
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.