Hi ,
I have two dates
Say date1 β9/23/2024β and date2 β9/20/2024β
I need to check whether dt1 falls within fifteen days of date1 or prior to that
What will be the expression
Hi ,
I have two dates
Say date1 β9/23/2024β and date2 β9/20/2024β
I need to check whether dt1 falls within fifteen days of date1 or prior to that
What will be the expression
I thought we need to use something like though I was getting error
DateDiff(dateinterval.Day,str_startdate,cdate(str_signdate)).ToString
You can use that as well but both should be suprrounded by cdate and no need of .tostring thwn we need to check if differenceis positive and lessthan 15
Cheers
Hi,
Try using these package it may work βFeatSystems.DateTime.Activitiesβ
Are you looking for:
@Anil_G 's answer should work then, or do you need a more elaborate and foolproof solution?
Is it something DateDiff(dateinterval.Day,cdate(str_startdate),cdate(str_signdate))
I am getting as -26 for this condition. If I need to put in If condition and check
just need to see <=15 .need to omit the sign?
for example start_date<=15 ?
Does signing or starting happen first?
sign date happens first.after that start date
any other method we can do?
to check if a particular date falls within a range of 15 days from the other date
Then you have it reverse here:
Import this namespace, if it is not there:
DateSigned = DateTime.ParseExact(strSignedDate, "M/d/yyyy", CultureInfo.InvariantCulture)
DateStarted = DateTime.ParseExact(strStartedDate, "M/d/yyyy", CultureInfo.InvariantCulture)
dblDateDiff = DateAndTime.DateDiff(DateInterval.Day, DateSigned, DateStarted)
If Condition:
dblDateDiff > 0 AndAlso dblDateDiff <= 15
Then:
$"Date difference is OK: {dblDateDiff}"
Else:
$"Date difference is NOT OK: {dblDateDiff}"