Need to Find Eligible date is between from date to date

I have,
From date : 01/01/2022 (string format)
To date : 31/12/2022 (string format)
Eligible date : 04/12/2022 (Date format) (Dynamically changed)
Need to find Is Eligible date is between From_date to To_date,
If it is between it is eligible
if it is not means, not eligible.

Hi @Vicky_K

Please have a look on the below to having a logical understanding on this requirement,

Hope this will be useful. Thank you.

1 Like

Hi @Vicky_K ,

Try with the below Expression :

EligibleDate>DateTime.ParseExact("01/01/2022","dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture) AndAlso DateTime.ParseExact("31/12/2022","dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture)>EligibleDate

Here, EligibleDate is a variable of type DateTime

1 Like

Hey @Vicky_K

You can parse the string to date and perform the comparison as below,

EligibleDate > Date.ParseExact(FromDate,"dd/MM/yyyy",Nothing) AndAlso EligibleDate < Date.ParseExact(ToDate,"dd/MM/yyyy",Nothing)

The above will return True or False from which you can proceed further.

Hope this helps

Thanks
#nK

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