Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Datepart().........to check if date is vallid
#1
Not Solved Rolleyes 
Hi

1)I am entering the date in input pox and the passing the value to datepart function
mydate=inputbox("enter the date")/if i enter date as 29/29/29
datepart("d",mydate)/then it should display 29 as date and when i click ok it should display invalid date.but not workin

2)if i use the same for "date" its is workin
datepart("d'",date)//it displays properly.i mean the system date,as date is a key word

Clarification:Can u jus help me in telling wheater the way i am passing the value in 1 is wrong
Reply
#2
Not Solved
hi swapna ,
What do you want to display ? is it the system date or the inputed date?
Reply
#3
Not Solved
Hi sreekanth
i jus need to chceck wheather date is valid
for system date tht function works fine............i jus wan any input given....but it should validate wih respect to present date.i mean
1)when we book a ticket if i give ist amrch it should give invalid date

2) this is regarding date fornmat ......it should even chk this like for mm/dd/yy.........if i give 29/02/08...the,it should give an exception


Regards
Swapna
Reply
#4
Not Solved
Oh...ok........sreekant jus let me knoe both the cases , i mean system date and inputed date

swapna
Reply
#5
Not Solved
Sorry swapna i dont know how to check the format exactly because QTP normally deals with the outer part of the application.And the exception(logic of wether to take the inputted value or not) will be dealt by the back end.

you can verify the lenth,wether Numerical or not etc but not the format of the data.

the outer application designer (ex:HTML designer)can keep a lot of properties for object he can keep the format as a property as well if he wishes.(but this is not a normal practise).

i can't say that this can not be done because, iam not sure of your appication.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Help Datatable Parameterzing Date debindas 1 3,672 08-30-2012, 11:43 PM
Last Post: QTPScript
  How To Select Date From a Calender Image Where Date field is non editable? RameshKrishnan 1 4,043 05-28-2012, 09:29 PM
Last Post: defcon3
  Date Format change mv8167 9 50,080 03-05-2012, 08:54 PM
Last Post: SteveS
  Returned Date Format mv8167 3 5,990 07-06-2011, 09:25 AM
Last Post: rajpes
  Future Date from Calendar SS001 2 6,375 05-31-2010, 01:16 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 2 Guest(s)