Get just the hours from a field (09:34:23) (1 Viewer)

BukHix

Registered User.
Local time
Today, 14:37
Joined
Feb 21, 2002
Messages
379
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

Registered User.
Local time
Today, 14:37
Joined
Feb 21, 2002
Messages
379
Duh! This will do it: LEFT (T_TIMEIN, 2)
 

SQL_Hell

SQL Server DBA
Local time
Today, 19:37
Joined
Dec 4, 2003
Messages
1,360
or you could use a t-sql- function called datepart()
 

Users who are viewing this thread

Top Bottom