Re: Problem with Datepart
You could pad the output with extra values.
Re: Problem with Datepart
Here's an example with GetDate()
SQL Code:
--Tested On Microsoft SQL Server 2000 - 8.00.2040
select Left('0'+ convert(varchar,datepart(hour,getdate())),2)
Re: Problem with Datepart
There is no need to use the DatePart function.
The Convert function can format the datetime fields into hh:mm.
Code:
select tr.Descr [Room], tb.Purpose [Purpose], tb.Description [Description],
convert(varchar(5), tb.starttime, 108) [Start Time],
convert(varchar(5), tb.endtime, 108) [End Time],
tu.name [Requested by]
from tbl_booking tb inner join tbl_resource tr