K
Kenneth Keeley
Hi,
I am trying to get the results out of an SQL database where the date is
greater than todays date.
this is thecode that I am trying to use.
SQLQuery = new SqlDataAdapter("SELECT Id, Title, Publication, InsertDate,
NoPages, Colour, Status " +
"FROM Features WHERE InsertDate >#" +
DateTime.Now.ToString("dd/MM/yyyy") +
"# AND Publication='x' OR Publication='y' ORDER BY " + strSortBy + ";",
DataBaseConnection);
All I keep getting is this error "Incorrect syntax near '#'." What am I
doing wrong. The query is copied straight from an access database query to
the same SQL Database.
Thanks for any help
Kenneth
I am trying to get the results out of an SQL database where the date is
greater than todays date.
this is thecode that I am trying to use.
SQLQuery = new SqlDataAdapter("SELECT Id, Title, Publication, InsertDate,
NoPages, Colour, Status " +
"FROM Features WHERE InsertDate >#" +
DateTime.Now.ToString("dd/MM/yyyy") +
"# AND Publication='x' OR Publication='y' ORDER BY " + strSortBy + ";",
DataBaseConnection);
All I keep getting is this error "Incorrect syntax near '#'." What am I
doing wrong. The query is copied straight from an access database query to
the same SQL Database.
Thanks for any help
Kenneth