I've got to make a query from C# and compare with a datetime. Datetime is stored in my database like this:
2014-11-09 00:00:01
and I'm using this query:
SELECT *
FROM Table
WHERE DATETIMEVAR = '19/11/2014 0:00:01' AND OTHERVAR = 1
But it's not in the same format. Is there a way to convert from System.DateTime in C# to dates in SQL Server, or a way to cast from SQL Server the datetime in that format?? Should I check with like instead of = in Where clause.
Thanks.