Skip to Content
0
Apr 11, 2014 at 10:57 AM

Determining a Time ID from a DateTime field

21 Views

I have a DT field that I want to break into 1/2hr designators (so 1-48). Is there a better way to do this than with just a lengthy CASE WHEN (or "old school" IF THEN ELSE)?

So, for example 03/12/2014 12:05:30am becomes 1 (1st half hour after midnight), while 03/12/2014 11:37:33pm would be 48 (last half hour before midnight).

Thanks much!

(fwiw, CR2k8)