I am creating a SQL Server function
ALTER function [dbo].[GetAbnormalProductionHourFlag]
(@startDate date,
@endDate date,
@employeeId integer,
@lowBand decimal,
@highBand decimal)
returns integer
as
begin
declare @flagCount integer
set @flagCount = (select count(*)
from AHFAB_vTimecardLines
where lmlActualStartTime >= @startDate
and (lmlActualEndTime < @endDate or lmlActualEndTime is null)
and lmlEmployeeID = @employeeId
and (jmoActualProductionHours < @lowBand or jmoActualProductionHours > @highBand))
return @flagCount
and call the function
select dbo.GetAbnormalProductionHourFlag1('2017/02/01', '2017/02/17', 5124, 0.10, 3.00)
When I try to debug, for some reason the value of @lowBand on the watchlist SQL debugger is passed as 0, instead of 0.1
Is there a special way to pass decimal value parameters to a SQL Server function?
I am confused, I thought by putting decimal on parameters type, it should pass the correct value.
I would appreciate it if you could shed some light on what I miss or what I do wrong.
decimal(9,3)