Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sent_sara
Constraint Violating Yak Guru
377 Posts |
Posted - 2007-04-01 : 02:49:55
|
| Hi guys can anybody solve the issue given below:Create procedure bt_time char(10)as --Validation is:1) if the user enters character in the bt_time variable system should throw error2) bt_time should contain only time between 1-24.the user can enter only the range between 1-24,1.30,8.00 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-01 : 03:25:59
|
use isdate() KH |
 |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2007-04-03 : 01:32:21
|
| I'm thinking that ISDATE() just isn't going to work with just the number of decimal hours being provided.If you are doing these entries from a gui, the data should be validated there, perhaps by using an Input Mask.--Jeff Moden |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-04-03 : 03:10:57
|
quote: Originally posted by Jeff Moden I'm thinking that ISDATE() just isn't going to work with just the number of decimal hours being provided.If you are doing these entries from a gui, the data should be validated there, perhaps by using an Input Mask.--Jeff Moden
I agree with youLike ISNUMERIC, ISDATE also should be handled with careSELECT ISDATE(3000),ISDATE('2000'),ISDATE(2000),ISDATE('MARCH 06'),ISDATE('MARCH 2006'),ISDATE('MAR 2006')It seems that user wants to validate date before sending data to table. If that is the case it should be validated at front endMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|
|
|