Update the column if month should be less-than 1 to current month

Hi all,

actually first i have to check column C
A.)
Update input file column C to Current Month - 1
(eg: current month 05 means 05-1 = 04)

Buddy @Naveen.Ch

Great…

  1. you can have a assigned variable like with datatype int32
    out_month = Convert.ToInt32(DateTime.Now.AddMonths(-1).ToString(“MM”))

2.Then you can use write cell to enter this value to that cell you want to

3.Again use a assign activity like
Out_Run_Date = DateTime.Now.ToString(“dd.MM.yyyy”)

Now compare this date with the each row value in thatcolumn by iterating through the datatable with for each row loop with if condition like
row(4).ToString.Equals(Out_Run_Date)
Then use Add queue item to add that row value to the queue created in the orchestrator

Thats all buddy you are all done

Hope this would help you

Cheers

1 Like

Thanks for the quick response @Palaniyappan

I will check and let you the solution

Hi @Palaniyappan

I am getting date value like April means 4
But I want to enter like 04
I have to assign 0 before 4 ?

@Naveen.Ch
No buddy usually month in MM will return two digits buddy may be in excel it didn’t take the value 0 in front

To check whether we get 04 or not use a writeline activity just to check whether it displays the right value or not

Cheers

Fine better enter it as string to the excel buddy
That would work like this
out_month = DateTime.Now.AddMonths(-1).ToString(“MM”)

Cheers

In writeline it’s printing 4 but I want 04

Can I do append
Why because if I am not giving 04 in excel I will get validation error bro

1 Like

Buddy @Naveen.Ch
i tried the same in my studio, and i m getting as 04 buddy see

Fine buddy if its getting better we can append and try that would work either

Cheers

1 Like

Is that working buddy

Cheers

1 Like

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