in report formula trigger how we use the nvl function with date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • upadhyay92
    New Member
    • Mar 2008
    • 1

    in report formula trigger how we use the nvl function with date

    how can we use the date column of table like dt_bl_date is date datatype column of table a
    in table valu of column is null then
    i want to use the valu of column in and add like 30 dys in the value of cloumn


    d=nvl(:dt_bl_da te,0)+30

    but it gives err

    tell me
    everybody
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    Originally posted by upadhyay92
    how can we use the date column of table like dt_bl_date is date datatype column of table a
    in table valu of column is null then
    i want to use the valu of column in and add like 30 dys in the value of cloumn


    d=nvl(:dt_bl_da te,0)+30

    but it gives err

    tell me
    everybody
    So what you want as an output when you add 30 to NULL? How can you store a NUMBER in date datatype variable.

    If the date is NULL, then what you want as an output? Add 30 days to SYSDATE or something like that??

    Comment

    • subashsavji
      New Member
      • Jan 2008
      • 93

      #3
      Originally posted by upadhyay92
      how can we use the date column of table like dt_bl_date is date datatype column of table a
      in table valu of column is null then
      i want to use the valu of column in and add like 30 dys in the value of cloumn


      d=nvl(:dt_bl_da te,0)+30

      but it gives err

      tell me
      everybody
      [code=oracle]

      function CF_1Formula return date is
      begin
      if :hiredate is null then
      :cp_1:= :hiredate+30;
      return (:cp_1);
      else
      return(:hiredat e);
      end if;
      exception
      when others then
      srw.message(100 0,sqlerrm);
      end;
      //
      [/code]

      Note :- You will get result null because you want to add 30 into null date value so anything plus null result will be null. :hiredate------use------>sysdate
      Last edited by amitpatel66; Mar 5 '08, 11:48 AM. Reason: code tags

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        try using

        sysdate +30

        Comment

        Working...