Date format error in vb.net ?
        Posted  
        
            by ahmed
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by ahmed
        
        
        
        Published on 2010-04-19T11:56:59Z
        Indexed on 
            2010/04/19
            12:03 UTC
        
        
        Read the original article
        Hit count: 361
        
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 ???
© Stack Overflow or respective owner