If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to get 12 Hour shift from Date/Timecolumn

Started by cognos74, 07 Nov 2016 11:53:31 AM

Previous topic - Next topic

cognos74

Hi

I am trying to get 12 hour shift from my Date Time column but no lucky.  can anyone please help me in this.

Recorded Date/Time is the column name. I need to get 12 hour shift our of that column which is everyday morning 7am to 7pm(12 hours)

thanks,

charlie

Not sure if I am missing something in your requirement but this looks pretty straight to me. You can try writing a case statement that will look like the below (excuse syntax errors please).

case when extract(recorded_date,HH) between 7 and 19 then 'Day Shift'
else 'Night Shift' end


cognos74

Thank you very much Charlie,  logic worked perfectly..