How to get the particular date of the present month


I need to take a particular date from the present month how to get the particular date example I have given below please look into it once.

Example: Present month of 15th (15/05/2023)

if the current date is <=15th I need to do some condition.

Please help me to find out the solution.



If you want to check if the current date is less than required date…and if you want to compre only the day part then use as below < 15

If you need to compre with specific date

Then Now < Cdate("15/05/2023")


yes I did that but after condition match I have to set some rage


- If today’s date is <= 15th of the month, set range to: 16th of previous month to end of month.
- If today’s date is > 15th of the month, set range to 1st through 15th of current month.

How to do this? help me in this


In what range dates are there is it know?

If yes then use the range in the then side and else side as needed


I don’t understand what you’re saying.


May I know what range you wan to set? And where?

Can you please show it visually


No I just assign the value into the variable.

Example if it is <= 15 of present month then assign the value (04/01/2023 - 04/30/2023) into the date_range variable


if it is > 15 of present month then assign the value (05/01/2023 - 05/15/2023) into the date_range variable



May I know what is the variable type of your daterange…is it string

To get the previous month range use this

For first of previous month - Now.Addmonths(-1).ToString("MM/01/yyyy")

For last day of previous month


First date of current month - Now.ToString("MM/01/yyyy")

15 of current month - Now.ToString("MM/15/yyyy")

You can combine them as you need



1 Like

Try This

StartDate = If(Now.Day>15,Now.AddDays(-(Now.Day-1)),Now.AddMonths(-1).AddDays(-(Now.Day-1)))
EndDate = If(Now.Day>15,DateTime.ParseExact(“15”+Now.ToString(“/MM/yyyy”),“dd/MM/yyyy”,Nothing),DateTime.ParseExact(DateTime.DaysInMonth(Now.AddMonths(-1).Year,Now.AddMonths(-1).Month).ToString+Now.AddMonths(-1).ToString(“/MM/yyyy”),“dd/MM/yyyy”,Nothing))

Yes, this also I work I tried in a different way

1 Like

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