if object_id('dbo.fn_Modulo42Decimals') is not null
drop function dbo.fn_Modulo42Decimals
create function dbo.fn_Modulo42Decimals (
@First decimal(18, 2),
@Second decimal(18, 2) ) returns int
cast(@First * 100 as int) & cast(@Second * 100 as int)
select dbo.fn_Modulo42Decimals(5995.32, 154.67)
Not sure if it actually works right, always hated math
and how about when I have a value of 48 digits long? I declared a float(50),
but when I perform a division it keeps displaying an error message about the maximum precision of a numeric being 38. How can I do this or work around?
well, it's a barcode consisting of an employee's company number, department, dates, .... It's in total 50 digits long, the first 48 containing data and the last 2 are check digits (modulo 97). I need to check if the data is correctly recognized by our scanning software and if not, present that record to the operator that has to manually correct it.