1st date and last date of every month in an order

Hello Team,

Kindly help me with an solution regarding how to get 1st date and last date of every month in an order till current month ?

Thank you,

@Samje

check the reference

1 Like

@Samje ,

Use assign activity and use below code to get the dates.

Get the First Date of the Current Month:

New DateTime(DateTime.Now.Year, DateTime.Now.Month, 1)

Get the Last Date of the Current Month :slight_smile:

New DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month))

Thanks,
Ashok :slight_smile:

1 Like

Hi @Samje

Check the below xaml file.
Sequence11.xaml (9.1 KB)

Output:
image

Please let me know if the workflow doesn’t open.

Regards

1 Like

Hi Ashok,

Thank you for your reply.

Can you help me with order from January till current month 1st date and last date ?

Thanks,
Sam

Hi Varun,

Thank you for your reply.

It’s works.

Regards,
Sam

1 Like

You’re welcome @Samje

Happy Automation!!

Hi Varun,

Can you help me with previous year 2023 Instead of 2024 ?

Thank you,

1 Like

Hi @Samje

Can you raise a new query on this.

Meanwhile this is the below is the code:

Sequence11.xaml (9.6 KB)

Regards

@Samje ,

Here you have a code

Workflow.xaml (12.7 KB)

Update the for first date and last dates as per your requirement and you will have the dates in the range you want.

Thanks,
Ashok :slight_smile:

1 Like

Hi Varun,

ok. Thank you

Regards,
Sam

1 Like

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