I put a question up yesterday about how to specify dates in an SQL Query. I recieved two suggestions, either
WHERE EntryDate > '2008-12-01'
or
WHERE EntryDate > '01/12/2008'
However I'm getting some real problems and wonder if someone can suggest what I'm doing wrong (maybe its some setting). If I use a date format of '2008-12-01' in a view in SQL Server 2005 it runs the query fine in SQL Server 2005 (ie open view), but as soon as I try to run the view in Visual Studio 2005 with a data provider it complains data type resulted in out of range datetime value. However, if I use the date format '01/12/2008' in the view, then SQL Server complains when I try and run the view and gives out the same out of range datetime, but the view runs ok in Visual Studio. I don't think whether either give the right result, but think the one in SQL server does (using 2008-12-01) but the visual studio one doesn't.
WHERE EntryDate > '2008-12-01'
or
WHERE EntryDate > '01/12/2008'
However I'm getting some real problems and wonder if someone can suggest what I'm doing wrong (maybe its some setting). If I use a date format of '2008-12-01' in a view in SQL Server 2005 it runs the query fine in SQL Server 2005 (ie open view), but as soon as I try to run the view in Visual Studio 2005 with a data provider it complains data type resulted in out of range datetime value. However, if I use the date format '01/12/2008' in the view, then SQL Server complains when I try and run the view and gives out the same out of range datetime, but the view runs ok in Visual Studio. I don't think whether either give the right result, but think the one in SQL server does (using 2008-12-01) but the visual studio one doesn't.