Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
seniors Please help---New to QTP and forum---Datatable question
#2
Not Solved
hi Tarry,

Use the below script
Code:
Text= DataTable("A", dtGlobalSheet)

Dim sText


'Splitting the given string with the delimiter _ and saving it in the array called sText

sText = Split(Text,"_")

'Displaying the length of character before _


Msgbox "First Seven Text before _ is:  " &sText(0)


If  len( sText(0)) >6 or len( sText(0)) <6Then

Msgbox"Lenght of character before _ is 6"

else

Msgbox"Lenght of character before _ is not equal to 6"

End If



'Displaying the lenght of character after and before _



Msgbox "Second Six Character (yyyymm) after and before _ is: " &sText(1)


'i dont think we can validate the second condition but any how we can check weather the month is valid or not

'Splliting the date as YYYY and MM using mid function

mnth = Mid (sText(1),5)

If mnth < 0 or mnth > 12 Then

msgbox "The date format is not valid"

else

yr = Mid (sText(1),1,4)

msgbox "Date is "&MonthName(mnth)&yr

End If

' Comparastion btw two date


Msgbox "Third Six Character (yyyymm) after 2nd _ is: " &sText(2)

If sText(2) > sText(1) Then

    Msgbox "Second date is Greater than the First"

Else

   Msgbox "Second date is Not Greater than the First"
  
End If

Thanks
Stephen
Reply


Messages In This Thread
RE: seniors Please help---New to QTP and forum---Datatable question - by stephenlb4u - 05-28-2009, 05:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  The most reputed and oldest Q & A forum on HP Unified Functional Testing tool (earlie qtptouft 0 1,346 09-30-2015, 01:52 PM
Last Post: qtptouft
  Hello All -Nice forum to start learning QTP. Few questions QTP.learning 0 1,896 05-18-2014, 04:10 PM
Last Post: QTP.learning
  Question about QTP tutorial - Yousuf 1 2,645 11-15-2013, 09:25 PM
Last Post: Yousuf
  qtp interview question raaj123 2 2,421 01-21-2013, 03:12 PM
Last Post: Ankesh
  Datatable add and datatable import sheet wheelercha 4 33,634 06-14-2012, 04:53 PM
Last Post: Arul

Forum Jump:


Users browsing this thread: 1 Guest(s)