Hi, Every one
hope every one doing well
I am confused about UDF , how its work , what is the purpose of using the @ here ,
here here is one code can u explain what it will going to do?
if explained thank you ,
hope every one doing well
I am confused about UDF , how its work , what is the purpose of using the @ here ,
here here is one code can u explain what it will going to do?
if explained thank you ,
Code:
CREATE function [dbo].[UDF_Production_Report1_Working2] ( @TXTFromDate datetime, @TXTToDate datetime, @MFGPurpose varchar(10) ) returns table as return ( SELECT a.ref_date,convert(integer,(sum(datediff(MI,b.start_time,b.end_time)) / 60)) + (convert(numeric(9,2),convert(numeric(9,2),(sum(datediff(MI,b.start_time,b.end_time)) - (convert(integer,sum(datediff(MI,b.start_time,b.end_time))/60) * 60))) / 100)) as hours FROM dps_mast a inner join dps_chld1 b on a.ref_no = b.ref_no and a.ref_date = b.ref_date inner join pls_mast c on a.pls_no = c.ref_no and a.pls_date = c.ref_date inner join prd_mast d on c.wo_no = d.no and c.wo_date = d.date where d.production_type = @mfgpurpose and a.ref_date between @TXTFromDate and @TXTToDate group by a.ref_date ) go
Comment