I current am looking back 3 months from my current date, however that 3 months may change and I want to set the month value to a variable
Current
strCurrentStart.AddMonths(-3)
Tested
strCurrentStart.AddMonths(-strMonthPeriod)
This does not work. Can someone point me in the right direction.
Thanks
san.nagane
(San Nagane)
November 13, 2019, 4:34pm
2
Hi @MattRPA2019 ,
Convert strMonthPeriod to integer or change it’s datatype to integer
tmays
(Troy)
November 13, 2019, 4:35pm
3
Hi @MattRPA2019
Looks like you may be trying to add months to a string variable (strCurrentStart). It must be used with a DateTime variable type.
If you’ll provide your xaml file, we’ll take a look.
Cheers.
Troy
sarathi125
(Parthasarathi)
November 13, 2019, 4:35pm
4
@MattRPA2019 ,
You can use add months for datetime variable types only.
dateTimeDate.AddMonths(intMonths)
Here dateTimeDate is my date variable.
intMonths is my integer type variable to add months, if you want pass negative vale the add minus symbol to the intMonths.
1 Like
MattRPA2019
(Matt O'Neill)
November 14, 2019, 10:37am
5
Thanks, that did the trick.
system
(system)
Closed
November 17, 2019, 10:37am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.