Date logic for subrating the -10 days

Hi

I want logic that i want to subtract 10 business days from today date

Can u create logic
and share me the workflow

@katta_nikhil

A xaml is already shared for the same

Cheers

@Anil_G yeah but … i want to subtract the days (-10) days

If you want to subtract 10 days then in the xaml shared by @Anil_G, Wherever AddDays(10) is given, convert it to AddDays(-10)

Hi @katta_nikhil

currentDate= DateTime.Now (Datatype: System.Datetime)
currentDate.AddDays(-10)

eg: today date is 07/18/2023
date before 10 business days will be 07/08/2023


Refer the above image

This syntax will also return 10 days back date:

Now.Date.AddDays(-10).ToString("MM/dd/yyyy") (Datatype: System.String)

Hope it helps!!
Regards,

Hi @katta_nikhil

result = DateTime.Today.AddDays(-10)
output: 07/08/2023 00:00:00(DateTime variable)

result = DateTime.Today.AddDays(-10).ToString(“MM/dd/yyyy”)
output: 07/08/2023 (String variable)

BusinessDay_followupdate.xaml (12.1 KB)

can anyone please tell me here the changes

Have made the changes instead 0f +1, I have given below syntax:

DT_EndDate= DT_EndDate.AddDays(-1)

The initial value will be 10 only

Hope it helps!!
Regards,

@katta_nikhil

There is no change…in argument instead of 10 pass -10

Cheers

@katta_nikhil

Type this in add data row activity in text.xaml:
{dt5(0)(0).ToString, dt5(0)(1).ToString, id.Substring(0,id.Length-1), dt5(0)(3).ToString, Sum.ToString, dt5(0)(5).ToString, dt5(0)(6).ToString, dt5(0)(7).ToString}

And
use AddDays(-10) instead of 1 day

No bro its not working … its gng to infinte loop

@katta_nikhil

Have made the changes instead 0f +1, I have given below syntax:

DT_EndDate= DT_EndDate.AddDays(-1)

The initial value will be 10 only
Try this
Hope it helps!!
Regards,

If u dont mind can u do in this file
Logic-date.zip (12.5 KB)

Hi @katta_nikhil

Made the required changes and uploaded the zip file for reference.

Logic-date.zip (222.3 KB)

Hope it helps!!
Regards,

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