How can i get result "My Dream Table Result"
CREATE TABLE #temp(
[count] int,
[Time] nvarchar(50) )
DECLARE @DateNow DATETIME,@i int
SET @DateNow='00:00'
set @i=1;
while(@i<1440)
begin
set @DateNow=DATEADD(minute, 1, @DateNow)
insert into #temp ([count], [Time]) values(0,@DateNow)
set @i=@i+1
end
SELECT [count],CONVERT(VARCHAR(max), [Time], 104) as [Time] from #temp
drop table #temp
Table Result:
Count---------Time0-------------Jan 1 1900 12:01AM
0-------------Jan 1 1900 12:02AM
0-------------Jan 1 1900 12:03AM
0-------------Jan 1 1900 12:04AM
But i don't like thsi table Time format is not ok. i need this table
My Dream Table Result:
Count---------Time0---------------12:01
0---------------12:02
0---------------12:03
0---------------12:04
.
.
.
.
.
0--------------22:01
0--------------22:02
0--------------22:03
0--------------22:04