View Full Version : hOURS AND MINUTES


Pauldohert
02-01-2007, 07:11 AM
This should be easy but I can't seem to do it - how do I format a datetime so I just see the hh:nn


Ta

Ron_dK
02-01-2007, 07:31 AM
Set your format to "Short Time " .
Would that help ?

Sorry in SQL :

DATEPART(portion, Hh:Mi)

Pauldohert
02-01-2007, 07:47 AM
Sorry didn't get that,

DatePart(hh,@Date)

gives me the hours

DATEPART(portion, Hh:Mi) ????

Cheers

Ron_dK
02-05-2007, 11:35 PM
Would this work :
DatePart(mi,n,@Date)

SQL_Hell
02-06-2007, 03:12 AM
select cast(DatePart(hh,getdate())as varchar) + ':' + cast(DatePart(mi,getdate())as varchar)