当我将类型传递给存储过程时,任何想法都会忽略日期
ALTER PROCEDURE [dbo].[hms_GetBenefitsByDateType]
(
@id int,
@startDate datetime,
@EndDate datetime,
@bType int
)
AS
SET NOCOUNT ON;
SELECT benefit.emp_no, benefit.record_id, benefit.contract_id, benefit.career_id, benefit.date_from, benefit.date_to, benefit.benefit_type, benefit.monthly_value, benefit.benefit_provider, benefit.level_of_cover, benefit.current_benefit, benefit.previous_monthly_cost, benefit.benefit_change_details, benefit.notes, benefit.level_description, benefit.monthly_annual, benefit.cover_level, benefit.qualifying_reason, benefit_type.desc_
FROM benefit INNER JOIN
benefit_type ON benefit.benefit_type = benefit_type.code
WHERE (benefit.benefit_type = @bType) or (benefit.emp_no = @id) and (benefit.date_from >= @startDate) and (benefit.date_to <= @EndDate)
其中 date from 是 2006-01-01 00:00:00.000 并且 date to 是 1900-01-01 00:00:00.000 产生的结果是以下 11,4,21,123,2006-01-01 00:00: 00.000,1900-01-01 00:00:00.000,3,15.00,1,2.00,1,0.00,None ,Notes ,Children ,1,1,1,Medical Cover - Children
12,6,14,27,2013 -06-21 00:00:00.000,2013-06-21 00:00:00.000,3,500.00,0,0.00,1,0.00,