sql server - How does 12/30/9999 date in SQL work in a stored procedure? -
i'm reading stored procedure , noticed date parameter default 12/30/9999 , in condition. how work in stored proc?
in parameter section..
alter procedure [dw].[sp_policydetail] @inforcedate date = '12/30/9999', @policyeffectivedatestart date = null, @policyeffectivedateend date = null, @underwriter_full_name varchar(100) = null, @branch_office_name varchar(100) = null
in condition..
where p.line_of_business_cd= 'exp' , p.policy_status_cd<> 'tmp' , ( @inforcedate = '12/30/9999') or ( p.policy_status_cd= 'bnd' , p.policy_effective_dt<= @inforcedate , p.policy_expiration_dt > @inforcedate , p.cancellation_effective_dt > @inforcedate ) ) , (@policyeffectivedatestart null or (p.policy_effective_dt between @policyeffectivedatestart , @policyeffectivedateend)) , p.from_date <= @inforcedate , p.to_date > @inforcedate
sql server can convert strings date using default server date format mm/dd/yyyy in case.
sql server can convert strings of valid format cast
, convert
if need, , provide format
Comments
Post a Comment