Hi Team,
I have a cell activity that reads from an Excel file a date and I want to add a month or year to this date so how can I do that
Hi Team,
I have a cell activity that reads from an Excel file a date and I want to add a month or year to this date so how can I do that
Please put an input and output
For adding a month:
yourDateVariable = yourDateVariable.AddMonths(1)
For adding a year:
yourDateVariable = yourDateVariable.AddYears(1)
it’s giving me an error (Add month is not a member in integer)
Hi @omar_ismail
If you want to Add Year:
Year = DateTime..ParseExact(Input,"MM/dd/yyyy",System.GLobalization.CultureInfo.InvariantCulture).AddYears(1).ToString("MM/dd/yyyy")
If you want to Add Month:
Month = DateTime..ParseExact(Input,"MM/dd/yyyy",System.GLobalization.CultureInfo.InvariantCulture).AddMonths(1).ToString("MM/dd/yyyy")
Regards
Hi @omar_ismail
Sorry it was my bad that I inserted two dots:
Check this:
If you want to Add Year:
Year = DateTime.ParseExact(Input,"MM/dd/yyyy",System.GLobalization.CultureInfo.InvariantCulture).AddYears(1).ToString("MM/dd/yyyy")
If you want to Add Month:
Month = DateTime.ParseExact(Input,"MM/dd/yyyy",System.GLobalization.CultureInfo.InvariantCulture).AddMonths(1).ToString("MM/dd/yyyy")
Change the format of date according to yours
Regards
Please put the format of your date if it is “dd/MM/yyyy” or “MM/dd/yyyy”
Year=DateTime.ParseExact(OldDate,"Your Format",System.Globalization.Culturalinfo.InvarientCulture).AddYears(1).ToString("MM/dd/yyyy")
Month=DateTime.ParseExact(OldDate,"YourFormat",System.GLobalization.CultureInfo.InvariantCulture).AddMonths(1).ToString("MM/dd/yyyy")
Please put your excel screenshot
Hi @omar_ismail
Please Type CDate(OldDate)
there
Please refer the screenshot. The same I have mentioned in that too @omar_ismail
Regards
In imports panel import System.Globalization
And also CultureInfo “I” Should be Capital
Hi @omar_ismail
Input:
Workflow:
Output:
Xaml:
Sequence36.xaml (13.4 KB)
Please check the workflow and replicate your process.
Regards
Is the error gone if it is not gone then cut the expression and simply paste the expression
DateTime.ParseExact(OldDate,"MM/dd/yyyy",System.Globalization.CultureInfo.InvariantCulture).AddYears(1).ToString("MM/dd/yyyy")
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.