Having issue with getting a date variable to update correctly. On After Update event.
I want the code to subtract one minute from a date.But the macro sc_date only subtracts days as the smallest value.
$new_date = sc_date({itemActiveDate}, “yyyy-mm-dd”, “-”, 1, 0, 0);
// $new_date = sc_date({itemActiveDate}, “yyyy-mm-dd”, “-”, 1, 0, 0); //works for subtracting 1 days
$itemrevisionID = {itemrevisionID}-1;
$update_sql = “update item "
. “set itemInActiveDate = '”.$new_date.”’ "
. “where itemID = {itemID} and itemrevisionID = '”.$itemrevisionID."’ "
;
sc_exec_sql($update_sql);
sc_commit_trans();