Date Difference Issue - AsEnumerable

I am having issue with the date difference
Input (string)
image

currently using assign activity

ResultDT. AsEnumerable().Where(function(r)(DateDiff(DateInterval.Day, DateTime.ParseExact(r(“Component Start Date”).ToString.Trim,“dd/MM/yyyy”, nothing),now.Date) <= 1)).CopyToDataTable

I understand my string format is “dd/MM/yyyy” and now.date format is (“MM/dd/yyyy”)

image

I need to need dates from today and next 45 days from the Component start column

Found the Solution

ResultDT. AsEnumerable().Where(function(r)(DateDiff(DateInterval.Day, DateTime.ParseExact(r(“Component Start Date”).ToString.Trim,“dd/MM/yyyy”, nothing),now.Date) <= 1 AND DateDiff(DateInterval.Day, DateTime.ParseExact(r(“Component Start Date”).ToString.Trim,“dd/MM/yyyy”, nothing),now.Date) >= -45)).CopyToDataTable

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.