I am attempting to group records by 12 minute intervals. I.E. 12:00pm-12:12pm, 12:13pm-12:25pm, etc. I am currently grouping in 10 minute intervals...although the current method won't exactly work for 12. Can anyone give some advice on this? See the SQL below:
Code:
SELECT TIMESTAMP(LEFT(char(nvs.TXN_DT_TM),13) || '.' || RIGHT(LEFT(char(nvs.TXN_DT_TM),15),1) || '0.00.000000') as YYYY_MM_DD_HH_10MM,
count(DISTINCT nvs.UZRL) AS "Unique Users",
cast(count(DISTINCT nvs.UZRL) as float)/6 AS "Labor Hours"
FROM db.table nvs
WHERE nvs.TXN_DT_TM >= '2011-01-01-00.00.00' and date(nvs.TXN_DT_TM) >= (current date)
AND (nvs.MVKD = 'RDSC' AND nvs.PFHS = 'Y')
GROUP BY TIMESTAMP(LEFT(char(nvs.TXN_DT_TM),13) || '.' || RIGHT(LEFT(char(nvs.TXN_DT_TM),15),1) || '0.00.000000')