i have excel which consists of date column and i want to find out the extact days of that date from today’s date and write to the another column like Ageing.
e.g
today’s date - excel date = actual days
20-Mar-2023(want to use system date not hardcode date) - 02-Mar-2023 = 18 days and write in adjacent column. excel data for reference
The error is because, the NoOfDays is a String variable, where as the Output from DateDiff is an Long type variable. You can easily convert it to String using .ToString at the end.
one more thing i want to write in in Ageing column for each row of invoice date after calculation, how to amke that expression so that it will write one after the other.
If you’re using the Write Range Activity inside the For Each Row Activity, just keep it outside after the For Each Row activity and check the execution.
First parameter to be passed is the DateInterval type, which specifies if we need the difference in days or Months or Years.
Second parameter is first Date value which should be of type Date
Third parameter is the Second date value.
The other parameters are optional.
Additionally, since the data in your case is present in Excel/Datatable, we would need to convert it to DateTime type which is done using CDate() method. Now - Represents the current Date and Time.
I believe the Initial Requirement of this Topic is satisfied/solved. You could create another Topic on this requirement, so that we can provide the help on it separately.
Although for the mentioned, there are many posts already on “How to send Table/Datatable in Email”, Search for the topics in Here and you would find many results. You could adopt one of them.
One such post is provided below :
If you have further questions on this requirement, feel free to create a Separate Topic.