I need a personal assistance to work with a subtraction between two dates. I need the result that date when greater than 24 hours to appear as one days and zero hours. And goes like on. Here my query attached to the staff take a look at the first tab has several sections refer to stages of production, and within this stage has a maximum and minimum. We must show it in the format that I explained to you. Grateful.
max
(aggr(IF(CODIGO_ESTAGIO = 21, (([DATA_PROD]) - ([DATA_BAIXA]))*24),CODIGO_ESTAGIO,ORDEM_PRODUCAO))
min
(aggr(IF(CODIGO_ESTAGIO = 21, (([DATA_PROD]) - ([DATA_BAIXA]))*24),CODIGO_ESTAGIO,ORDEM_PRODUCAO))