Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


sgrose
2010-08-23T21:22:28Z
I would like to use VC to pass parameters to a program which will run on the first of every month. I need to pass in the parmaters of last months date range from the first to the last date of the month. I can't seem to get it right. Keep in mind that on January 1st I would also need to change the year to the previous year.

This {DATENOWADD(Days|-1|M/d/yyyy)} should give me the last day of the month, assuming the job is ran on the first of the month. It's getting the first day of the month and changing the year that I'm having a problem with.

Thanks for you help.
Sponsor
Forum information
sgrose
2010-08-23T21:47:40Z
I think I figured it out and it has a bonus of giving a month to date range when it's run on any date.

All I needed to do was subtract the days of yesterdays date {DATENOWADD(Days|-1|%d)} from today's date to get the first day of the month.


{DATENOWADD(Days|-{DATENOWADD(Days|-1|%d)}|M/d/yyyy)}
{DATENOWADD(Days|-1|M/d/yyyy)}
Scroll to Top