Date Extracted from datetime in sql server 2008 -
i have column of datetime , give date stored procedure , check against column in sql table. entries in column contains time date have compare date part of column given input. please reply
alter procedure [dbo].[db] @date datetime begin select * [dbo].[production_schedule] datepart('yyyy',date)= datepart('yyyy-mm-dd',@date) end; exec [dbo].[db] '2002-07-01',1,0
i have give date in procedure have select rows have same date in column date.
try this
select * [dbo].[production_schedule] convert(date,date)= convert(date,@date)
Comments
Post a Comment