Using variable in this code

Hi,

I have the below code which searches through a data table and finds rows containing the current date -3 days.

I would like to change this to add in a specific date which would be stored in a variable. For example, I would like to search for rows that have the date 12/10/2020.

I tried adding the variable In_strDate which is a text variable but was getting an error

Hi,

Can you try to change Where state as the following?

Where new DateTime(2020,12,10) = dateTime.ParseExact(d(0).toString,"MM/dd/yyyy HH;mm:ss",CultureInfo.InvariantCulture

or we can set DateTime variable in advance like targetDate = new DateTime(2020,12,10)

Then

Where targetDate= dateTime.ParseExact(d(0).toString,"MM/dd/yyyy HH;mm:ss",CultureInfo.InvariantCulture

Regards,