1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Code for the check in oracle sql

Discussion in 'SQL PL/SQL' started by ullas77, Feb 16, 2014.

  1. ullas77

    ullas77 Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Please can someone help me to resolve this below mentioned query with the oracle-sql code :

    If the start date is not equal to end date then query should fire the error.

    output should satisfy for all the below scenario mentioned:

    Start Date End Date

    01-Dec-2013 05-Dec-2013
    01-Dec-2013 UN-DEC-2013
    01-Dec-2013 07-UNK-2013
    01-Dec-2013 UN-UNK-2013
    01-Dec-2013 UNK-2013
    01-Dec-2013 UN- - 2013
    01-Dec-2013 - - 2013

    Thanks in advance
    Ullas. S
     
  2. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi Ullas,

    Can you elaborate your requirement?

    What is it meant by?
     
  3. ullas77

    ullas77 Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    hi, i would be thanks for ur interst shown. for the above mentioned detail. i have to compare the two dates from start date to end date. the start should equal to end date its the clean database report. if the start date is not equal to end date i should get the pop up of any information stating that start date is not equal to end date.
    Thank U in advance
     
  4. ullas77

    ullas77 Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    please as mention above the code i required is for START DATE NOT EQUAL TO END DATE and the Scenario i have been given in first mail it should satisfy the all.

    Thanks
     
  5. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi,

    In rdf report you can try like this....

    if start_date!=end_date then
    srw.message(23134,'Error in dates');
    end if;

    Hope this will help you....
     
  6. ullas77

    ullas77 Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Hi,

    THank U, I tried this code it works for only start date not equal to end date but when the sceniaro is

    Start Date End Date

    01-Dec-2013 05-Dec-2013
    01-Dec-2013 UN-DEC-2013
    01-Dec-2013 07-UNK-2013
    01-Dec-2013 UN-UNK-2013
    01-Dec-2013 UNK-2013
    01-Dec-2013 UN- - 2013
    01-Dec-2013 - - 2013

    it have the error for char to number conversion. so how can it will be resolved.

    Thank U
    Ullas. S
     
  7. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,345
    Likes Received:
    347
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You're NOT using date columns in your table, apparently; this is a HUGE mistake you need to correct because such strings CANNOT be converted/resolved to valid dates.
     
  8. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    What is the data type of end_date?

    In this column first one is date. Remaining all are not dates. How system will understand these are dates?