Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Date Functions
#2
Solved: 11 Years, 4 Months ago
Check this , i hope it's usefull for u

Code:
strBirthDate="10/10/2000"
vmonth = dateDiff("m",strBirthDate, date())
vday= datediff("d", strBirthDate, date())
If month(Now()) > month(strBirthDate)  OR month(Now()) = month(strBirthDate) Then
     If day(strBirthDate) = day(Now()) OR Day(Now()) > day(strBirthDate)Then
          vyear = DateDiff("y", year(strBirthDate), year(Now()))
    else
        vyear = DateDiff("y", year(strBirthDate), year(Now())) - 1    
    end if
    
else
       vyear = DateDiff("y", year(strBirthDate), year(Now())) - 1
End If

msgbox "Year::"& vyear
Reply


Messages In This Thread
Date Functions - by Anna - 07-29-2008, 06:50 PM
RE: Date Functions - by Raj - 07-29-2008, 07:19 PM
RE: Date Functions - by Anna - 07-29-2008, 07:25 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Perform some functions whenever QTP Stop button is pressed smartkarthi 2 3,217 08-22-2013, 11:43 AM
Last Post: smartkarthi
  exit parent functions as well Shridevi.Salagare 3 3,853 07-31-2013, 12:15 AM
Last Post: Ankur
  Datatable in functions shwetasharma 2 3,510 03-26-2013, 08:00 AM
Last Post: sams001
  Problem with using two functions in the same action mhanaan 2 3,042 09-14-2012, 10:09 PM
Last Post: mhanaan
  Need Help Datatable Parameterzing Date debindas 1 3,675 08-30-2012, 11:43 PM
Last Post: QTPScript

Forum Jump:


Users browsing this thread: 1 Guest(s)