View Full Version : Get just the hours from a field (09:34:23)


BukHix
12-13-2005, 04:28 PM
I have a table that holds time stamps like this:

1108 - 9:46:08
1108 - 9:49:47
1104 - 10:13:54
1105 - 11:41:53
1105 - 11:55:11
etc

How do I just get the hours part of that field? Something like the following.

1108 9:46:08 - 9
1108 9:49:47 - 9
1104 10:13:54 - 10
1105 11:41:53 - 11
1105 11:55:11 - 11

BukHix
12-13-2005, 04:35 PM
Duh! This will do it: LEFT (T_TIMEIN, 2)

SQL_Hell
12-15-2005, 02:53 AM
or you could use a t-sql- function called datepart()