mesa-fab-approval/Programmability/Functions/fnGetLotCount_Probe.sql
Mike Phares ab800974b7 Programmability objects from database
Removed commented code
Added fn_GetExpiredTECNByOriginator
2024-12-12 12:15:46 -07:00

33 lines
808 B
Transact-SQL

USE [FabApprovalSystem]
GO
/****** Object: UserDefinedFunction [dbo].[fnGetLotCount_Probe] Script Date: 11/21/2024 11:31:55 AM ******/
SET
ANSI_NULLS ON
GO
SET
QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE FUNCTION [dbo].[fnGetLotCount_Probe] (
-- Add the parameters for the function here
@IssueID INT
) RETURNS FLOAT AS BEGIN DECLARE @ProbeCount INT -- Declare the return variable here
SET
@ProbeCount = 0
SET
@ProbeCount = (
SELECT
COUNT(*)
FROM
Lot L
WHERE
L.IssueID = @IssueID
AND L.Location IN ('6300', '6400 ', '6600')
) -- Return the result of the function
RETURN @ProbeCount
END
GO