Commit 4347ad2f authored by dasharatha.vamshi's avatar dasharatha.vamshi

Upload New File

parent f1e639a2
SELECT subquery.batch_no,
subquery.process_stage_id,
subquery.master_product_id,
subquery.batch_start,
concat((subquery.hours)::text, ' hrs', ' : ', lpad((subquery.minutes)::text, 2, '0'::text), ' mins') AS duration_formatted
FROM ( SELECT batch_details.batch_no,
batch_details.process_stage_id,
batch_details.master_product_id,
batch_details.batch_start,
((date_part('day'::text, (now() - batch_details.batch_start)) * (24)::double precision) + date_part('hour'::text, (now() - batch_details.batch_start))) AS hours,
date_part('minute'::text, (now() - batch_details.batch_start)) AS minutes
FROM batch_details
WHERE ((batch_details.batch_start IS NOT NULL) AND (batch_details.batch_end IS NULL))) subquery;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment