How to compaire current date with excel date

I have excel with multiple details,I have added excel data to queue and then i am creating performer to access the data from queue from that i have Hire date column in queue that also i am accessing from queue.Now I have to consider one scenario where
1.If my Hire date<2week of emplyee then i have to add that into other excel with dd/mm/yyy formt i have to compaire hiredate with current date of system

Hi,

Once you have access to the queue item with in_TransctionItem.Reference for example (when you keep the hire date in the refrence column of queue transaction item) and current date, then you can take the difference between today’s date and the hire date.

cdate(Now.ToshortdateString)
input_date=cdate(in_TransctionItem.Reference.tostring)(“dd-MM-yyyy”)

If you get an error here change the date formats to match each other.

Check the link below for date difference function:

Difference between two dates - Help - UiPath Community Forum

Keep the date difference in an int32 variable → variable_name. You can convert date difference to integer with Cint(variable_name) if there are errors.

Afterwards, use an if function. You can use variable < 2 as condition;
inside if, use excel application scope and write cell or write range activity (works in the background).

If you have uipath.excel.activities package you can use those activities as well.

Hope it helps.

Hi @Sandhya_Gajare

  1. Use Assign Activity
    To- HireDate
    Value - In_transactionItem.SpecificContent(“Hire Date”).toString("dd-MM-yyyy).

*HireDate is a variable with datatype as Datetime.
*(“Hire Date”) Keep Column name as present in excel.

  1. For Comparing HireDate
    Current Date = Datetime.Now.toString(“dd-MM-yyyy”)

You can compare with Both the dates as needed.

Thanks & Regards
Loveleet saini

its better if i get code

Hello @Sandhya_Gajare

I think modify date activity can solve your requirement.

How to Modify Date in UiPath? Modify Date activity explained with demo

Thanks

Hi @Rahul_Unnikrishnan i will watch the video but if i get proper code then its usefull to me and also i undersatnd how i do plz its urgent

is there anyboday plz help me out

please help me with code