I tried the `CONVERT(TIME,sample_datetime)`, but my software does not recognize TIME as a type.

How do I take sample `datetime` and extract the time from it in one variable and the day of the week from it in another variable?
['https://Stackoverflow.com/questions/7917076', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/971115/']
Using [DATEPART()](http://msdn.microsoft.com/en-us/library/ms174420.aspx) function:

```
// returns 4
SELECT DATEPART(day, '2010-09-04 11:22:33')

// returns 7
SELECT DATEPART(dw, '2010-09-04 11:22:33')

// returns 11:22:33
SELECT CAST(DATEPART(HOUR, '2010-09-04 11:22:33') AS VARCHAR(2)) + ':'
     + CAST(DATEPART(MINUTE, '2010-09-04 11:22:33') AS VARCHAR(2)) + ':'
     + CAST(DATEPART(SECOND, '2010-09-04 11:22:33')AS VARCHAR(2))

```

Regarding TIME data type - it introduced since Sql Server 2008:

```
SELECT CAST('2010-09-04 11:22:33'  as Time)

```
you didnt specify sql server version but 

`select datepart(dw,yourdate)` should do it.