Anyone know to make this equation work? TO_CHAR({...
# general
j
Anyone know to make this equation work? TO_CHAR({lineitemstartdate},'MM/DD/YYYY HHMISS') -TO_CHAR({lineitemenddate},'MM/DD/YYYY HHMISS')
s
Doesnt make much sense to substract strings. You should probably be casting them to dates to do subtraction on them.
j
so if i switch to TO_DATE and use formula date it will subtract those?
s
date - date is not going to give you a date, so formula date does not make sense.
s
Subtracting two dates in Oracle will give you a floating point number, representing the # of days between the two dates, so this would make more sense to be a numeric formula. What sort of result are you expecting?
Also, subtracting an end date from a a start date is a little weird. In most cases that is going to give you a negative number, unless your start date is after the end date.
k
how about MONTHS_BETWEEN function?
j
Im attempting to get the minutes it took to start and complete a wave
s
To_date both of them, subtract, then convert to hours/minutes/seconds (multiply by 24, 60, 60) as needed