Question
5
Replies
3765
Views
Posted: April 17, 2018
Last activity: April 20, 2018
Closed
Solved
How to add year in a date and compare with current date
Hi,
I have requirement like i have to fetch the date of a transaction from DB table in which I have to add certain year(eg: 7 yrs.) in activity and then compare it with current date (eg: Currentdate>transaction+7yrs) and based on that comparision I have to update the status of that transaction..
ow to add year in a date and compare it with current date.
Regards,
SorenTara
You can use below functions to achieve your requirement.
param.FutureDate= @DateTime.addCalendar(@DateTime.CurrentDate("","EST"),7,0,0,0,0,0,0)
param.IsValidTransaction= @differenceBetweenDateTimes(@CurrentDateTime(),param.FutureDate,true,"")>0
I hope this will help.