Hi,
I have a stored proc with datetime as data type. I need only time from that.
ALTER PROCEDURE [dbo].[MarketResearch]
AS
BEGIN
select current_count as CurrentCount,
CAST(progress_info as datetime) progressinfo,
from dbo.market
return 0;
end
this stored proc is returning date and time. i just need time from this. can you guys help me how to format?
Thanks.
select convert(varchar(100), getdate(), 9) union all
select convert(varchar(100), getdate(), 109) union all
select convert(varchar(100), getdate(), 13) union all
select convert(varchar(100), getdate(), 113) union all
select convert(varchar(100), getdate(), 114) union all
select convert(varchar(100), getdate(), 20) union all
select convert(varchar(100), getdate(), 120) union all
select convert(varchar(100), getdate(), 21) union all
select convert(varchar(100), getdate(), 121) union all
select convert(varchar(100), getdate(), 126) union all
select convert(varchar(100), getdate(), 127) union all
select convert(varchar(100), getdate(), 130) union all
select convert(varchar(100), getdate(), 131)
ALTER PROCEDURE [dbo].[MarketResearch]
AS
BEGIN
select current_count as CurrentCount,
CAST(progress_info as datetime) progressinfo,
convert(varchar(100), progress_info, 114)
from dbo.market
the data type in sql table is 'Time' i wanted to change to datetime that is why i am using cast. now the result is date and time. i want to eliminate the date. any idea?
Thanks
This does not make sense - if the column is already time then why cast to datetime if you want return the time? Is there something else you are doing that is not included in that procedure?