Posts: 7
Threads: 3
Joined: Feb 2008
Reputation:
0
02-29-2008, 12:23 PM
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
Posts: 29
Threads: 1
Joined: Mar 2008
Reputation:
0
03-05-2008, 10:59 AM
hi swapna ,
What do you want to display ? is it the system date or the inputed date?
Posts: 7
Threads: 3
Joined: Feb 2008
Reputation:
0
03-05-2008, 12:00 PM
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
Posts: 7
Threads: 3
Joined: Feb 2008
Reputation:
0
03-05-2008, 02:40 PM
Oh...ok........sreekant jus let me knoe both the cases , i mean system date and inputed date
swapna
Posts: 29
Threads: 1
Joined: Mar 2008
Reputation:
0
03-05-2008, 05:48 PM
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.