cancel
Showing results for 
Search instead for 
Did you mean: 

Can not compare text with date.

PeterVígh
Level 4

Hello,guys.

I'm working on a project where i need to get some data from excel. The data is in my collection and in the last column there is a date which is in text format and i need to compare that with Today() how can i format that text to date? That value is in Current Values tab. And when it is done i need to get the whole row export to a new collection. It's a process studio problem but i had only object studio in discussion menu.



------------------------------
Peter Vígh
------------------------------
3 REPLIES 3

Hi, Peter,

there is either function ToDate() and if you are lucky it will convert your text to date or you need to use MakeDate function and give it parameters from your text field - day, month and year - then you can compare it with Today().

Regards,

------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------

Hi, Zdeněk,

Thank you, it solved my problem. Now i got another one. I made a loop to go through the collection and put there a decision (if statement) if its true i want to get the whole row and put it to my new collection. I put an action stage there with Business object - Collections and Action - Copy rows . I placed a counter to the loop and Start row -  that counter , End row - that counter as well. It is fine but when i find the first row which i want to put to my new collection it copy that row but the it just ignored the next following rows.... So my new collection just have 1 row.



------------------------------
Peter Vígh
------------------------------

Hi, Peter,

with collections it is a bit more complicated. If you look at your collection now you will not have there only one row but only the last one row as copy row will always recreated the "target" collection from the scratch if you know what I mean. So you need to use Append Collection which is part of Utility - Collection Manipulation object. So your logic must be following - copy 1 row (or more) to Temp collection and then merge or append Temp collection to your Target (or Final) collection.

While writing above I read your requirements once again and I believe there is much smarter and easier way to achieve what you want ;).

Once you convert all the rows to date use Filter collection and set filter "[Column with date]<"&Today() (or whatever condition you need) and you are done - one box which does all ;). No need to use copy rows or append collection stuff.

Regards,

------------------------------
Zdeněk Kabátek
Head of Professional Services
NEOOPS
http://www.neoops.com/
Europe/Prague
------------------------------