Try this -
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
StartDate = "2013-01-31"
EndDate = "2014-06-07"
ActualDate = "2013-05-05"
Call IsDateBetween(ActualDate,StartDate,EndDate,IsBetween)
Print IsBetween
Public Function IsDateBetween(ActualDate,StartDate,EndDate,IsBetween)
A = DateDiff("d", StartDate, ActualDate)
B = DateDiff("d", ActualDate, EndDate)
C = DateDiff("d", StartDate, EndDate)
If (((A >= 0) and (B>=0) and (C>=0)) or ((A <= 0) and (B<=0) and
(C<=0)))Then
print "Actual Date is in between the given 2 dates"
IsBetween = 1
Else
print "Actual Date is NOT in between the given 2 dates"
IsBetween = 0
End If
End Function
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
On Wednesday, 18 August 2010 03:58:03 UTC-7, nagesh wrote:
>
> Hi all,
>
> I need code to find the entered date should exist in between two dates
>
> ex: i have a date 30-Jan-2009 i need to check this date should exist
> in between 01-Jan-2009 and 31-Jan-2009
>
> Thanks in advance
> Venkat
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.