sql - convert time portion of date to an int -
sql - convert time portion of date to an int -
i have column called enteredindate
includes info such as:
2012-10-10 18:02:00 2012-10-11 13:30:00 2012-10-11 14:27:00 2012-10-12 14:14:00
how create new column has int
info value next enteredindate
column this?
1802 1330 1427 1414
use datepart
:
select datepart(hour, enteredindate) * 100 + datepart(minute, enteredindate)
sql sql-server
Comments
Post a Comment