Home » Developer & Programmer » Forms » Military time validation
Military time validation [message #471211] Thu, 12 August 2010 19:59 Go to next message
coolguy01
Messages: 64
Registered: August 2006
Member
I have a time field which i need to validate for military time. for example like e.g.1630. Time entered outside of military time range should not be permitted e.g. 1364, 2510.

Thanks
Re: Military time validation [message #471212 is a reply to message #471211] Thu, 12 August 2010 20:06 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
SQL> select to_date('1259','HH24MI') from dual;

TO_DATE('1259','HH2
-------------------
2010-08-01 12:59:00

SQL> select to_date('1364','HH24MI') from dual;
select to_date('1364','HH24MI') from dual
               *
ERROR at line 1:
ORA-01851: minutes must be between 0 and 59


SQL> select to_date('2515','HH24MI') from dual;
select to_date('2515','HH24MI') from dual
               *
ERROR at line 1:
ORA-01850: hour must be between 0 and 23
Re: Military time validation [message #471214 is a reply to message #471212] Thu, 12 August 2010 20:18 Go to previous messageGo to next message
coolguy01
Messages: 64
Registered: August 2006
Member
I have a field with a length of 4 where the user enters a value from front form. So I need to write a when validate trigger to validate what user enters in the front end.
Re: Military time validation [message #471219 is a reply to message #471214] Thu, 12 August 2010 21:03 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>I need to write a when validate trigger to validate what user enters in the front end.
You have my permission to proceed to write the trigger.
Re: Military time validation [message #471220 is a reply to message #471219] Thu, 12 August 2010 21:46 Go to previous message
coolguy01
Messages: 64
Registered: August 2006
Member
The above solutions works .. thanks!!
Previous Topic: Unable to create excel object for Excel 2007/Windows 7
Next Topic: Runtime Remarks
Goto Forum:
  


Current Time: Thu Sep 19 17:21:55 CDT 2024