Hi, I have a DateTime column row and I declare a date string:
row:
2010-08-27 13:45:55
my string:
'2010-08-27'
Hi to check if that string is in that row ? I tried that query:
declare @year as nvarchar(4)
declare @month as nvarchar(2)
declare @day as nvarchar(2)
set @year = '2010'
set @month = '08'
set @day = '23'
select * FROM [dbo].[customer_import] CsrImport
where
(YEAR(CsrImport.import_date) = @year
AND MONTH(CsrImport.import_date) = @month
AND DAY(CsrImport.import_date) = @day)
but I see that it returns all rows (even that are not contains that date)