Change date record in excel

good afternoon, my doubt is that from my excel I read it through the activity, and I extract the values through and

the problem is that the value I need is in this format <25.09.2019 23:41>, what I want is that only the value <20190927> remains, I want to remove the recorded points and time, then set a value of two days later, that’s why it changes from 25 to 27
and finally register it in year-month-day

Clientes.xlsx (12.2 KB)

Corregir fecha de 2 dias.xaml (7.7 KB)

if you could help me

1 Like

help
@ppr
@Dave

you can use:

DateAdd(DateInterval.Day, 2, Date.ParseExact(“25.09.2019 23:41”, “dd.MM.yyyy HH:mm”, System.Globalization.CultureInfo.InvariantCulture)).ToString(“yyyyMMdd”)

1 Like

@borismh

Try this:

            DateTime dt = 25.09.2019 23:41
            requiredDateStr = dt.AddDays(2).Tostring("yyyyMMdd")
1 Like

@bcorrea
@lakshman

Thanks a lot
but how do I implement it in my xaml
through or as

1 Like

@Palaniyappan

help

1 Like

Hi
Hope these steps would help you resolve this
—use a excel application scope and pass the file path as input
—inside the scope use a READ RANGE activity and get the output with a variable of type datatable named dt
—now use a assign activity like this
row(“Fecha”) = DateTime.ParseExact(row(“Fecha”).ToString.SubString(0,10),”dd.MM.yyyy”,System.Globalization.CultureInfo.InvariantCulture).AddDays(2).ToString(“yyyyMMdd”)

This will convert all the row values as per our need
—next use a Write range Activity and mention the input as dt and enable add headers property

Cheers @borismh

1 Like

@borismh
have a look on this for starter help:
borismh_datecolconv.xaml (7.2 KB)

I would suggest to go for an each row activity instead of any LINQ for the conversion task

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.