This may already be out there but the search is down right now and I am anxious to find out what I am missing. I am sure that it is something small.
I have a sproc that I am wanting to create an input parameter for but I can not get it to accept a LIKE where clause when executing. Currently my conditions need to be
exact (1997-12-05) and I want to be able to enter something like (1997%)
What am I doing wrong.
Below is an example of my code.
CREATE PROCEDURE dbo.sp_CreatePayTypeDescPayPeriod
@EmployeeNumber INT
,@EnterCheckDate datetime
AS
SELECT DISTINCT
pc.emp_no
, pcpa.pay_type
, pc.check_date
, SUM(pcpa.hours) AS Hours
, SUM(pcpa.cmw_gross) AS Gross
FROM
pay_checks AS pc
INNER JOIN
pay_checks_pay_assoc AS pcpa
ON
pc.pay_checks = pcpa.pay_checks
WHERE
pc.emp_no = @EmployeeNumber
AND
pc.check_date LIKE @EnterCheckDate
I have a sproc that I am wanting to create an input parameter for but I can not get it to accept a LIKE where clause when executing. Currently my conditions need to be
exact (1997-12-05) and I want to be able to enter something like (1997%)
What am I doing wrong.
Below is an example of my code.
CREATE PROCEDURE dbo.sp_CreatePayTypeDescPayPeriod
@EmployeeNumber INT
,@EnterCheckDate datetime
AS
SELECT DISTINCT
pc.emp_no
, pcpa.pay_type
, pc.check_date
, SUM(pcpa.hours) AS Hours
, SUM(pcpa.cmw_gross) AS Gross
FROM
pay_checks AS pc
INNER JOIN
pay_checks_pay_assoc AS pcpa
ON
pc.pay_checks = pcpa.pay_checks
WHERE
pc.emp_no = @EmployeeNumber
AND
pc.check_date LIKE @EnterCheckDate