Fixing the d_elapsed and t_elapsed query