Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Error converting data type varchar to numeric.

$
0
0

Hi,

Here is my function

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[uf_getCamraTime](@camra_time decimal )
RETURNS decimal
AS
BEGIN

declare @num as decimal(10,2)
set @num=@camra_time
select @num=convert(varchar(10),floor(floor(@num/60)/60))+':'+convert(varchar(10),floor(@num/60)-(floor(floor(@num/60)/60))*60)+':'+convert(varchar(10),floor(@num-floor(@num/60)*60))

-- Return the result of the function
RETURN @num

END
GO

When I run it like [uf_getCamraTime] 53784.41 getting Error converting data type varchar to numeric.


Itsme


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>