Adding minutes to a date field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Yew12
    New Member
    • Mar 2008
    • 23

    Adding minutes to a date field

    Ok I have a date field called ADATE and I want to add the column "Duration(M in)" to this date.

    I have had ago at the code but it still doesn't work.

    I have tried dividing the added "Duration(M in)" but the answers are incorrect each time.


    Select TO_CHAR(adate, 'dd/Mon/yyyy hh24:mi')as adate, to_CHAR(ADATE + "Duration(Min)" , 'dd/Mon/yyyy hh24:mi') as NEW_ADATE, "Duration(M in)" from Appointment;

    Thanks very much in advance.
  • Yew12
    New Member
    • Mar 2008
    • 23

    #2
    Sorry I found out that () brackets were the key, so I include the code for others

    Select TO_CHAR(adate, 'dd/Mon/yyyy hh24:mi')as adate, to_CHAR(ADATE + ("Duration(Min) "/1440), 'dd/Mon/yyyy hh24:mi') as NEW_ADATE, "Duration(M in)" from Appointment;

    Thanks anyway

    Comment

    Working...