Solved

oracle date question

Posted on 2012-04-05
4
403 Views
Last Modified: 2012-06-21
filtration_start     date ( format - MM/DD/RRRR HH24:MI)

04/05/2012 14:24

filtration_end     date ( format - MM/DD/RRRR HH24:MI)

04/05/2012 15:30 changed this to 04/05/2012 13:10

I need to make sure end_filtration is > start_filtration

if :filtration_end < :filtration_start then
  msgbox.show('Error', 'Filtration End date has to be greater than Filtration Start date.', 'OK');
raise form_trigger_failure;
End if;

Does not work. Need help.
0
Comment
Question by:anumoses
  • 2
  • 2
4 Comments
 
LVL 73

Expert Comment

by:sdstuber
ID: 37814017
>>> Does not work.

why not?  what happens? error? no results? wrong results? keyboard catches fire?
0
 
LVL 73

Accepted Solution

by:
sdstuber earned 250 total points
ID: 37814028
are your fields actually dates or just strings that are human-readable as dates?

if they are dates then your if condition is correct
if they are strings, then convert them to dates when you compare them

if to_date(:filtration_end,'MM/DD/RRRR HH24:MI') < to_date(:filtration_start,'MM/DD/RRRR HH24:MI') then
0
 
LVL 6

Author Comment

by:anumoses
ID: 37814060
I tried to_date,

cursor stays on the field. No error message displayed
0
 
LVL 6

Author Closing Comment

by:anumoses
ID: 37814129
thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now