I get this error when I run the application Incorrect syntax near 12
, on debugging I found that this error is caused due to the # along with the date.
Dim backdate as datetime
backdate = DateTime.Now.AddDays(-1)
on binding the data to the grid to filter the backdate records this error is caused Incorrect syntax near 12.
myqry = " select SRNO,SUBJECT,ID where datesend =" backdate
Now i am trying to extract only the date or shall I divide the date into day , month and year with DATEPART
and take into a variable or convert the date or what should i do , Please help ???