if exists(select 1 from sysobjects where id=object_id(N'dbo.operman_worktime'))
drop function dbo.operman_worktime
go
create function dbo.operman_worktime
(@date_begin varchar(40),@date_end varchar(40))
returns varchar(40)
as
begin
declare @worktime varchar(40)
select @worktime=datediff(mi,@date_begin,@date_end)
return(@worktime)
end
go
select dbo.operman_worktime('2005-03-04 14:20:00','2005-03-04 14:25:00')
drop function dbo.operman_worktime
go
create function dbo.operman_worktime
(@date_begin varchar(40),@date_end varchar(40))
returns varchar(40)
as
begin
declare @worktime varchar(40)
select @worktime=datediff(mi,@date_begin,@date_end)
return(@worktime)
end
go
select dbo.operman_worktime('2005-03-04 14:20:00','2005-03-04 14:25:00')