I have written this query:
SELECT *
FROM w_tbl
WHERE DID NOT IN (SELECT DId FROM tbl_Assign)
AND CAST(MeasDateTime AS Date) = @dta
ORDER BY
CAST(MeasDateTime as DATE) DESC
So as you can see I am sending a parametrized query.
So I put 24/09/2010 00:00:00
for @dta
But I get this error:
Conversion failed when converting date and/or time from charterer string.
I tell you why I am doing this and my purpose:
I have a datetime column, and I want to select/fetch all data by date only (i.e. I don't want to fetch datetime wise, it has to be just according to date)