Date conversion problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • moyoal
    New Member
    • Mar 2008
    • 11

    Date conversion problem

    Dear All,

    Help me!

    From application i am sending date parameter to report which is in 'DD-MON-RRRR' format...

    In a table i have a column TRX_DATE in want to compare this column with Form date parameter

    when i check report argument its something like this
    [code=oracle]

    p_ca_set_of_boo ks_id='1'
    P_SET_OF_BOOKS_ ID='1'
    P_ORDER_BY='Cus tomer'
    P_CUSTOMER_NUMB ER_LOW='1001'
    P_CUSTOMER_NUMB ER_HIGH='1005'
    P_START_DATE='2 001/01/01 00:00:00'
    P_END_DATE='200 5/01/01 00:00:00'

    Receiving an error while running the report.

    ERR REP-1401: 'afterpform': Fatal PL/SQL error occurred.
    ORA-01861: literal does not match format string

    if :p_start_Date is NOT NULL then
    :lp_start_date := TO_CHAR(to_date (:p_start_date) ,'DD-MON-RRRR');
    end if ;

    if :p_end_date is NOT NULL then
    :lp_start_date := TO_CHAR(to_date (:p_end_date),' DD-MON-RRRR');
    end if ;
    [/code]

    please help me how do i compare my arguments with table column...

    regards,
    moyoal
    Last edited by amitpatel66; Apr 3 '08, 08:13 AM. Reason: code tags
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    You need to try something like this:

    [code=oracle]

    if :p_start_Date is NOT NULL then
    :lp_start_date := TO_CHAR(to_date (:p_start_date) ,'RRRR/MM/DD HH24:MI:SS');
    end if ;

    if :p_end_date is NOT NULL then
    :lp_start_date := TO_CHAR(to_date (:p_end_date),' RRRR/MM/DD HH24:MI:SS');
    end if ;

    [/code]

    Comment

    • moyoal
      New Member
      • Mar 2008
      • 11

      #3
      thanks for your reply amit....
      i will try will back to you
      regards

      Originally posted by amitpatel66
      You need to try something like this:

      [code=oracle]

      if :p_start_Date is NOT NULL then
      :lp_start_date := TO_CHAR(to_date (:p_start_date) ,'RRRR/MM/DD HH24:MI:SS');
      end if ;

      if :p_end_date is NOT NULL then
      :lp_start_date := TO_CHAR(to_date (:p_end_date),' RRRR/MM/DD HH24:MI:SS');
      end if ;

      [/code]

      Comment

      Working...